Training 2003

download Training 2003

of 44

Transcript of Training 2003

  • 8/3/2019 Training 2003

    1/44

    Training Report ForSummer Internship

    Submitted By:

    Abhishek Garg109208ECE-3NIT Kurukshetra

    2/12/2011

  • 8/3/2019 Training 2003

    2/44

    3

    2

    Preface

    Unless knowledge is applied in the field, it cannot

    attain perfection and maturity since theory often

    differs vastly from actual practice. Summer

    Internship which is an integral part of the course

    curriculum for the degree of B-Tech provides an

    opportunity to apply this knowledge and givesvaluable exposure to engineering student in

    functional areas of engineering and an opportunity

    to hone his skills in preparation for the corporate

    world. This opportunity was provided to me during

    the break between 4th Semester and 5th Semester. I

    believe my efforts during the Summer Internship

    have borne fruit in the form of this project report. I

    take this opportunity to present it and sincerely

    hope that it will enhance the knowledge of the

    readers, be it researcher or student and give them a

    sound base to expand upon.

  • 8/3/2019 Training 2003

    3/44

    3

    2

    Acknowledgement

    It is my privilege to express my gratitude to all those who

    have been the source of guidance, co-operation and help

    during my internship. I am thankful to Adception InfoTech

    Pvt. Ltd. for the providing me an opportunity to work with

    them during the summer training programme. I am

    thankful to Mr. Rohit Garodia, Technical Head, Adception

    Infotech Pvt. Ltd. for his guidance and constructive

    criticism which helped me greatly in the successful

    completion of my project.Without his guidance the

    internship could be so fruitful. A special word of thanks tothe staff at Adception Infotech Pvt. Ltd., Mr. Ramniwas,

    Ms. Sadhna Tiwari and Mr. Parteek Shrivastav for their

    time and patience in helping me understand the basics

    and clearing my doubts. Their contribution is sincerely

    appreciated.

    I would also like to thank all the faculty members at NIT

    Kurukshetra fortheir constant support and encouragement.

    Finally I owe a deep debt of gratitude to god and my

    parents who are my biggest source of strength, patience

    and inspiration. I am indeed blessed to have their love and

    support.

  • 8/3/2019 Training 2003

    4/44

    3

    2

    Contents

    Examining the working of Company

    Understanding Unix OS

    Learning Java

    Basic Concept of MySQl

    Web Designing Using

    HTML

    CSS

    PHP

    Using these to make:

    An Application on Facebook.com

    A Software for Referral System

  • 8/3/2019 Training 2003

    5/44

    3

    2

    Examining the working of Company

    Founded in 2010 by IIT Delhi Graduates, MyAdCorner brings to you a unique and convenientplatform for newspaper advertisement booking.

    Myadcorner is one stop for all your advertisement related needs. MyAdcorner is a website which

    showcases a comprehensive list of advertisement options and provide a simple interface to createand book advertisements.

    The Company is consolidating and bringing all the newspapers and offers on myadcorner.com sothat you can select offers as per your need and budget. Well researched and simple interface helpsyou to compose your ad & publish them or just save them which can be edited and published at alater date.

    For classified text ads, various decoration options are available and ad preview section gives youexact feel of how your ad will look in a newspaper.

    A user who wants to publish his advertisement or any other information in a newspaper visits thesite MYADCORNER.COM, places his order and receives a conformation slip for that. After thathis information is entered in companys data server and the respective order is placed in thedesired newspaper by staff members.

    Vision

    Advertising isn't a science. It's persuasion. And persuasion is an art. - William Bernbach

    MyAdCorner will soon be your one stop for all advertising needs, we will not only enhance the

    user experience by providing advertisement space or slot but also we will cater to the creative

    needs and the budget restrains by becoming a technological bridge between various organizations

    in the ad-world.

  • 8/3/2019 Training 2003

    6/44

    3

    2

    Understanding Unix OS

    Unix operating systems are widely used in servers, workstations, andmobile devices.[2] The Unixenvironment and theclientserverprogram model were essential elements in the development oftheInternet and the reshaping of computing as centered in networks rather than in individualcomputers.

    Originally, Unix was meant to be a programmer's workbench more than to be used to runapplication software. The system grew larger as the operating system started spreading in theacademic circle, as users added their own tools to the system and shared them with colleagues.

    Both Unix and the C programming language were developed by AT&T and distributed togovernment and academic institutions, which led to both being ported to a wider variety ofmachine families than any other operating system. As a result, Unix became synonymous withopen systems.

    Unix was designed to beportable, multi-tasking andmulti-userin atime-sharing configuration.Unix systems are characterized by various concepts: the use ofplain text for storing data; a

    hierarchicalfile system; treating devices and certain types ofinter-process communication (IPC)as files; and the use of a large number ofsoftware tools, small programs that can be strungtogether through a command line interpreterusingpipes, as opposed to using a single monolithicprogram that includes all of the same functionality. These concepts are collectively known as theUnix philosophy.

    Kernighan and Pike summarize this inThe Unix Programming Environment as "the idea that thepower of a system comes more from the relationships among programs than from the programsthemselves."

    The Unix system is composed of several components that are normally packaged together. By

    including in addition to the kernel of an operating system the development environment,libraries, documents, and the portable, modifiable source-code for all of these components, Unixwas a self-contained software system. This was one of the key reasons it emerged as an importantteaching and learning tool and has had such a broad influence.

    The inclusion of these components did not make the system large the original V7 UNIXdistribution, consisting of copies of all of the compiled binaries plus all of the source code and

    http://en.wikipedia.org/wiki/Server_(computing)http://en.wikipedia.org/wiki/Workstationhttp://en.wikipedia.org/wiki/Mobile_devicehttp://en.wikipedia.org/wiki/Mobile_devicehttp://en.wikipedia.org/wiki/Unix#cite_note-1http://en.wikipedia.org/wiki/Client%E2%80%93serverhttp://en.wikipedia.org/wiki/Client%E2%80%93serverhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Computer_networkinghttp://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Open_system_(computing)http://en.wikipedia.org/wiki/Portinghttp://en.wikipedia.org/wiki/Computer_multitaskinghttp://en.wikipedia.org/wiki/Multi-userhttp://en.wikipedia.org/wiki/Multi-userhttp://en.wikipedia.org/wiki/Time-sharinghttp://en.wikipedia.org/wiki/Time-sharinghttp://en.wikipedia.org/wiki/Plain_texthttp://en.wikipedia.org/wiki/File_systemhttp://en.wikipedia.org/wiki/File_systemhttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Programming_toolhttp://en.wikipedia.org/wiki/Command_line_interpreterhttp://en.wikipedia.org/wiki/Pipeline_(Unix)http://en.wikipedia.org/wiki/Unix_philosophyhttp://en.wikipedia.org/wiki/The_Unix_Programming_Environmenthttp://en.wikipedia.org/wiki/The_Unix_Programming_Environmenthttp://en.wikipedia.org/wiki/Kernel_(computer_science)http://en.wikipedia.org/wiki/Server_(computing)http://en.wikipedia.org/wiki/Workstationhttp://en.wikipedia.org/wiki/Mobile_devicehttp://en.wikipedia.org/wiki/Unix#cite_note-1http://en.wikipedia.org/wiki/Client%E2%80%93serverhttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Computer_networkinghttp://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Open_system_(computing)http://en.wikipedia.org/wiki/Portinghttp://en.wikipedia.org/wiki/Computer_multitaskinghttp://en.wikipedia.org/wiki/Multi-userhttp://en.wikipedia.org/wiki/Time-sharinghttp://en.wikipedia.org/wiki/Plain_texthttp://en.wikipedia.org/wiki/File_systemhttp://en.wikipedia.org/wiki/Inter-process_communicationhttp://en.wikipedia.org/wiki/Programming_toolhttp://en.wikipedia.org/wiki/Command_line_interpreterhttp://en.wikipedia.org/wiki/Pipeline_(Unix)http://en.wikipedia.org/wiki/Unix_philosophyhttp://en.wikipedia.org/wiki/The_Unix_Programming_Environmenthttp://en.wikipedia.org/wiki/Kernel_(computer_science)
  • 8/3/2019 Training 2003

    7/44

    3

    2

    documentation occupied less than 10MB, and arrived on a single 9-trackmagnetic tape. Theprinted documentation, typeset from the on-line sources, was contained in two volumes.

    Unix had a drastically simplified file model compared to many contemporary operating systems,treating all kinds of files as simple byte arrays. The file system hierarchy contained machineservices and devices (such asprinters,terminals, ordisk drives), providing a uniform interface, butat the expense of occasionally requiring additional mechanisms such as ioctl and mode flags toaccess features of the hardware that did not fit the simple "stream of bytes" model. ThePlan 9

    operating system pushed this model even further and eliminated the need for additionalmechanisms.

    Making the command interpreter an ordinary user-level program, with additional commandsprovided as separate programs, was another Multics innovation popularized by Unix. The Unixshell used the same language for interactive commands as for scripting (shell scripts there wasno separate job control language like IBM's JCL). Since the shell and OS commands were "justanother program", the user could choose (or even write) his own shell. New commands could beadded without changing the shell itself. Unix's innovative command-line syntax for creatingmodular chains of producer-consumer processes (pipelines) made a powerful programmingparadigm (co routines) widely available. Many later command-line interpreters have been inspired

    by the Unix shell.

    A fundamental simplifying assumption of Unix was its focus on ASCII text for nearly all fileformats. There were no "binary" editors in the original version of Unix the entire system wasconfigured using textual shell command scripts. The common denominator in the I/O system wasthe byte unlike "record-based" file systems. The focus on text for representing nearly everythingmade Unix pipes especially useful, and encouraged the development of simple, general tools thatcould be easily combined to perform more complicated ad hoc tasks.

    The Open Group is committed to working with the community to further the development ofstandards conformant systems by evolving and maintaining the Single UNIX Specification and

    participation in other related standards efforts. Recent examples of this are making the standardfreely available on the web, permitting reuse of the standard in open source documentationprojects , providingtest tools ,developing thePOSIXandLSB certification programs.

    Topics studied related to Unix:

    Linux operating system highlights Logging in and logging out Managing UNIX files and directories Sending and receiving mail

    Redirecting input/output Pipes and filters Background processing Basic network commands

    http://en.wikipedia.org/wiki/Magnetic_tape_data_storagehttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Computer_terminalhttp://en.wikipedia.org/wiki/Computer_terminalhttp://en.wikipedia.org/wiki/Disk_drivehttp://en.wikipedia.org/wiki/Ioctlhttp://en.wikipedia.org/wiki/Plan_9_from_Bell_Labshttp://en.wikipedia.org/wiki/Plan_9_from_Bell_Labshttp://en.wikipedia.org/wiki/Unix_shellhttp://en.wikipedia.org/wiki/Unix_shellhttp://en.wikipedia.org/wiki/Shell_scripthttp://en.wikipedia.org/wiki/Job_Control_Languagehttp://en.wikipedia.org/wiki/Pipeline_(Unix)http://en.wikipedia.org/wiki/Record-oriented_filesystemhttp://www.unix.org/online.htmlhttp://www.opengroup.org/comm/press/21jan04.htmhttp://www.opengroup.org/comm/press/21jan04.htmhttp://www.opengroup.org/testing/downloads.htmlhttp://www.opengroup.org/testing/downloads.htmlhttp://www.posixcertified.ieee.org/http://www.posixcertified.ieee.org/http://www.posixcertified.ieee.org/http://www.opengroup.org/lsb/cert/http://www.opengroup.org/lsb/cert/http://en.wikipedia.org/wiki/Magnetic_tape_data_storagehttp://en.wikipedia.org/wiki/Computer_printerhttp://en.wikipedia.org/wiki/Computer_terminalhttp://en.wikipedia.org/wiki/Disk_drivehttp://en.wikipedia.org/wiki/Ioctlhttp://en.wikipedia.org/wiki/Plan_9_from_Bell_Labshttp://en.wikipedia.org/wiki/Unix_shellhttp://en.wikipedia.org/wiki/Unix_shellhttp://en.wikipedia.org/wiki/Shell_scripthttp://en.wikipedia.org/wiki/Job_Control_Languagehttp://en.wikipedia.org/wiki/Pipeline_(Unix)http://en.wikipedia.org/wiki/Record-oriented_filesystemhttp://www.unix.org/online.htmlhttp://www.opengroup.org/comm/press/21jan04.htmhttp://www.opengroup.org/comm/press/21jan04.htmhttp://www.opengroup.org/testing/downloads.htmlhttp://www.posixcertified.ieee.org/http://www.opengroup.org/lsb/cert/
  • 8/3/2019 Training 2003

    8/44

    3

    2

    The main aim of studying UNIX was to gather basic knowledge about UNIX systems and to be

    able to work properly with minimum difficulties and complexities.

    Learning JAVA

    Java is aprogramming language originally developed by James Gosling at Sun Microsystems(now part ofOracle Corporation) and released in 1995 as a core component of Sun Microsystems'Java platform. The language derives much of its syntax from C and C++ but has a simplerobjectmodel and fewerlow-level facilities.

    The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for

    structured, generic, and object-oriented programming, Java was built almost exclusively as anobject-oriented language. All code is written inside a class, and everything is an object, with theexception of the primitive data types (integers, floating-point numbers, Boolean values, andcharacters), which are not classes for performance reasons.

    Unlike C++, Java does not support operatoroverloading ormultiple inheritanceforclasses. Thissimplifies the language and aids in preventing potential errors and anti-pattern design.

    Java uses similar commenting methods to C++. There are three different styles of comments: asingle line style marked with two slashes (//), a multiple line style opened with /* and closed with*/, and the Javadoc commenting style opened with /** and closed with */.

    The traditional Hello world program can be written in Java as:

    class HelloWorldApp {public static void main(String[] args) {

    System.out.println("Hello World!"); // Display the string.}

    }

    Source files must be named after the public class they contain, appending the suffix .java, forexample, HelloWorldApp.java. It must first be compiled into bytecode, using a Java compiler,

    producing a file named HelloWorldApp.class. Only then can it be executed, or 'launched'. TheJava source file may only contain one public class but can contain multiple classes with less thanpublic access and any number of public inner classes.

    A class that is not declared public may be stored in any .java file. The compiler will generate aclass file for each class defined in the source file. The name of the class file is the name of theclass, with .class appended. For class file generation, anonymous classes are treated as if theirname were the concatenation of the name of their enclosing class, a $, and an integer.

    http://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/James_Goslinghttp://en.wikipedia.org/wiki/Sun_Microsystemshttp://en.wikipedia.org/wiki/Oracle_Corporationhttp://en.wikipedia.org/wiki/Java_(software_platform)http://en.wikipedia.org/wiki/Syntax_(programming_languages)http://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Object_modelhttp://en.wikipedia.org/wiki/Object_modelhttp://en.wikipedia.org/wiki/Low-level_programming_languagehttp://en.wikipedia.org/wiki/Low-level_programming_languagehttp://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Operator_(programming)http://en.wikipedia.org/wiki/Operator_overloadinghttp://en.wikipedia.org/wiki/Multiple_inheritancehttp://en.wikipedia.org/wiki/Multiple_inheritancehttp://en.wikipedia.org/wiki/Anti-patternhttp://en.wikipedia.org/wiki/Javadochttp://en.wikipedia.org/wiki/Hello_world_programhttp://en.wikipedia.org/wiki/Java_compilerhttp://en.wikipedia.org/wiki/Inner_classhttp://en.wikipedia.org/wiki/Anonymous_classhttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/James_Goslinghttp://en.wikipedia.org/wiki/Sun_Microsystemshttp://en.wikipedia.org/wiki/Oracle_Corporationhttp://en.wikipedia.org/wiki/Java_(software_platform)http://en.wikipedia.org/wiki/Syntax_(programming_languages)http://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Object_modelhttp://en.wikipedia.org/wiki/Object_modelhttp://en.wikipedia.org/wiki/Low-level_programming_languagehttp://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Operator_(programming)http://en.wikipedia.org/wiki/Operator_overloadinghttp://en.wikipedia.org/wiki/Multiple_inheritancehttp://en.wikipedia.org/wiki/Anti-patternhttp://en.wikipedia.org/wiki/Javadochttp://en.wikipedia.org/wiki/Hello_world_programhttp://en.wikipedia.org/wiki/Java_compilerhttp://en.wikipedia.org/wiki/Inner_classhttp://en.wikipedia.org/wiki/Anonymous_class
  • 8/3/2019 Training 2003

    9/44

    3

    2

    Thekeywordpublic denotes that a method can be called from code in other classes, or that a classmay be used by classes outside the class hierarchy. The class hierarchy is related to the name ofthe directory in which the .java file is located.

    The keyword static in front of a method indicates a static method, which is associated only withthe class and not with any specific instance of that class. Only static methods can be invokedwithout a reference to an object. Static methods cannot access any class members that are not alsostatic.

    The method name "main" is not a keyword in the Java language. It is simply the name of themethod the Java launcher calls to pass control to the program. Java classes that run in managedenvironments such as applets andEnterprise JavaBean do not use or need a main() method. A Javaprogram may contain multiple classes that have main methods, which means that the VM needs tobe explicitly told which class to launch from.

    The main method must accept an array ofString objects. By convention, it is referenced as argsalthough any other legal identifier name can be used. Since Java 5, the main method can also usevariable arguments, in the form of public static void main(String... args), allowing the mainmethod to be invoked with an arbitrary number of String arguments. The effect of this alternate

    declaration is semantically identical (the args parameter is still an array of String objects), butallows an alternative syntax for creating and passing the array.

    The Java launcher launches Java by loading a given class (specified on the command line or as anattribute in aJAR) and starting its public static void main(String[]) method. Stand-alone programsmust declare this method explicitly. The String[] args parameter is an array ofString objectscontaining any arguments passed to the class. The parameters to main are often passed by meansof a command line.

    One characteristic of Java is portability, which means that computer programs written in the Javalanguage must run similarly on any hardware/operating-system platform. This is achieved by

    compiling the Java language code to an intermediate representation called Java bytecode, insteadof directly to platform-specificmachine code. Java bytecode instructions are analogous to machinecode, but are intended to beinterpreted by a virtual machine (VM) written specifically for the hosthardware.End-users commonly use a Java Runtime Environment (JRE) installed on their ownmachine for standalone Java applications, or in a Web browser for Javaapplets. StandardExample:

    1: class RangeClass {2: int[] makeRange (int lower, int upper) {3: int arr[] = new int[ (upper - lower) + 1 ];4:

    5: for (int i = 0; i < arr.length; i++) {6: arr[i] = lower++;7: }8: return arr;9: }10:11: public static void main (String arg[]) {12: int theArray[];

    http://en.wikipedia.org/wiki/List_of_Java_keywordshttp://en.wikipedia.org/wiki/List_of_Java_keywordshttp://en.wikipedia.org/wiki/Method_(computer_science)#Static_methodshttp://en.wikipedia.org/wiki/Enterprise_JavaBeanhttp://en.wikipedia.org/wiki/Enterprise_JavaBeanhttp://en.wikipedia.org/wiki/Array_data_typehttp://download.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://en.wikipedia.org/wiki/Variadic_functionhttp://en.wikipedia.org/wiki/JAR_(file_format)http://en.wikipedia.org/wiki/JAR_(file_format)http://en.wikipedia.org/wiki/Array_data_typehttp://download.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://en.wikipedia.org/wiki/Command-line_interfacehttp://en.wikipedia.org/wiki/Java_bytecodehttp://en.wikipedia.org/wiki/Java_bytecodehttp://en.wikipedia.org/wiki/Machine_codehttp://en.wikipedia.org/wiki/Machine_codehttp://en.wikipedia.org/wiki/Interpreter_(computing)http://en.wikipedia.org/wiki/Interpreter_(computing)http://en.wikipedia.org/wiki/Virtual_machinehttp://en.wikipedia.org/wiki/End-userhttp://en.wikipedia.org/wiki/End-userhttp://en.wikipedia.org/wiki/Java_Virtual_Machinehttp://en.wikipedia.org/wiki/Applethttp://en.wikipedia.org/wiki/Applethttp://en.wikipedia.org/wiki/List_of_Java_keywordshttp://en.wikipedia.org/wiki/Method_(computer_science)#Static_methodshttp://en.wikipedia.org/wiki/Enterprise_JavaBeanhttp://en.wikipedia.org/wiki/Array_data_typehttp://download.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://en.wikipedia.org/wiki/Variadic_functionhttp://en.wikipedia.org/wiki/JAR_(file_format)http://en.wikipedia.org/wiki/Array_data_typehttp://download.oracle.com/javase/7/docs/api/java/lang/String.htmlhttp://en.wikipedia.org/wiki/Command-line_interfacehttp://en.wikipedia.org/wiki/Java_bytecodehttp://en.wikipedia.org/wiki/Machine_codehttp://en.wikipedia.org/wiki/Interpreter_(computing)http://en.wikipedia.org/wiki/Virtual_machinehttp://en.wikipedia.org/wiki/End-userhttp://en.wikipedia.org/wiki/Java_Virtual_Machinehttp://en.wikipedia.org/wiki/Applet
  • 8/3/2019 Training 2003

    10/44

    3

    2

    13: RangeClass theRange = new RangeClass();14:15: theArray = theRange.makeRange(1,10);16: System.out.print(The array: [ );17: for (int i = 0; i < theArray.length; i++) {18: System.out.print(theArray[i] + );19: }20: System.out.println(]);

    21: }}

    Sun Microsystems has defined and supports four editions of Java targeting different applicationenvironments and segmented many of its APIs so that they belong to one of the platforms. Theplatforms are:

    Java Card for smartcards. Java Platform, Micro Edition (Java ME) targeting environments with limited resources. Java Platform, Standard Edition (Java SE) targeting workstation environments. Java Platform, Enterprise Edition (Java EE) targeting large distributed enterprise or

    Internet environments.

    Theclasses in the Java APIs are organized into separate groups calledpackages. Each packagecontains a set of related interfaces, classes andexceptions. Refer to the separate platforms for adescription of the packages available.

    The set of APIs is controlled by Sun Microsystems in cooperation with others through the JavaCommunity Process program. Companies or individuals participating in this process can influence

    the design and development of the APIs. This process has been a subject of controversy. Sun alsoprovided an edition called PersonalJava that has been superseded by later, standards-based JavaME configuration-profile pairings.

    Major release versions of Java, along with their release dates:

    JDK 1.0 (January 23, 1996) JDK 1.1 (February 19, 1997) J2SE 1.2 (December 8, 1998) J2SE 1.3 (May 8, 2000) J2SE 1.4 (February 6, 2002) J2SE 5.0 (September 30, 2004) Java SE 6 (December 11, 2006) Java SE 7 (July 28, 2011)

    For my part of internship I have used the software, Eclipse to work with java. This softwareautomatically creates java run time environment and is capable of compiling the program.

    http://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Java_Cardhttp://en.wikipedia.org/wiki/Java_Platform,_Micro_Editionhttp://en.wikipedia.org/wiki/Java_Platform,_Standard_Editionhttp://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Editionhttp://en.wikipedia.org/wiki/Class_(computer_science)http://en.wikipedia.org/wiki/Class_(computer_science)http://en.wikipedia.org/wiki/Java_packagehttp://en.wikipedia.org/wiki/Java_packagehttp://en.wikipedia.org/wiki/Interface_(Java)http://en.wikipedia.org/wiki/Exception_handlinghttp://en.wikipedia.org/wiki/Exception_handlinghttp://en.wikipedia.org/wiki/Java_Community_Processhttp://en.wikipedia.org/wiki/Java_Community_Processhttp://en.wikipedia.org/wiki/PersonalJavahttp://en.wikipedia.org/wiki/Application_programming_interfacehttp://en.wikipedia.org/wiki/Java_Cardhttp://en.wikipedia.org/wiki/Java_Platform,_Micro_Editionhttp://en.wikipedia.org/wiki/Java_Platform,_Standard_Editionhttp://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Editionhttp://en.wikipedia.org/wiki/Class_(computer_science)http://en.wikipedia.org/wiki/Java_packagehttp://en.wikipedia.org/wiki/Interface_(Java)http://en.wikipedia.org/wiki/Exception_handlinghttp://en.wikipedia.org/wiki/Java_Community_Processhttp://en.wikipedia.org/wiki/Java_Community_Processhttp://en.wikipedia.org/wiki/PersonalJava
  • 8/3/2019 Training 2003

    11/44

    3

    2

    Eclipse uses plug-ins to provide all functionality within and on top of the runtime system, incontrast to some other applications, in which functionality is hard coded. The runtime system ofEclipse is based onEquinox, an implementation of theOSGi core framework specification. TheEclipse SDK includes the Eclipse Java Development Tools (JDT), offering an IDE with a built-inincremental Java compiler and a full model of the Java source files. This allows for advancedrefactoring techniques and code analysis. The IDE also makes use of a workspace, in this case aset ofmetadata over a flat filespace allowing external file modifications as long as thecorresponding workspace "resource" is refreshed afterwards.

    Basic Concept of MySQl

    MySQL is arelational database management system (RDBMS)[2] that runs as a server providingmulti-user access to a number of databases. It is named after developerMichael Widenius'daughter, My.[3] The SQL phrase stands for Structured Query Language.[4]

    The MySQL development project has made itssource code available under the terms of the GNU

    General Public License, as well as under a variety ofproprietary agreements. MySQL was ownedand sponsored by a single for-profit firm, the Swedish companyMySQL AB, now owned byOracle Corporation

    The data in MySqL is stored in database objects called tables.

    A table is a collection of related data entries and it consists of columns and rows.

    Databases are useful when storing information categorically. A company may have a databasewith the following tables: "Employees", "Products", "Customers" and "Orders". MySQL can bebuilt and installed manually from source code, but this can be tedious so it is more commonlyinstalled from a binary package unless special customizations are required. On most Linuxdistributions thepackage management system can download and install MySQL with minimaleffort, though further configuration is often required to adjust security and optimization settings.

    Though MySQL began as a low-end alternative to more powerful proprietary databases, it hasgradually evolved to support higher-scale needs as well. Much of MySQL's appeal originates in itsrelative simplicity and ease of use, which is enabled by an ecosystem of open source tools such asphpMyAdmin. In the medium range, MySQL can be scaled by deploying it on more powerfulhardware, such as a multi-processor server with gigabytes of memory.

    There are however limits to how far performance can scale on a single server, so on larger scales,multi-server MySQL deployments are required to provide improved performance and reliability.A typical high-end configuration can include a powerful master database which handles data writeoperations and is replicated to multiple slaves that handle all read operations.

    Types of SQL Commands: .

    Data Definition Language (DDL) Data Manipulation Language (DML)

    http://en.wikipedia.org/wiki/Hard_codehttp://en.wikipedia.org/wiki/Equinox_(OSGi)http://en.wikipedia.org/wiki/Equinox_(OSGi)http://en.wikipedia.org/wiki/OSGihttp://en.wikipedia.org/wiki/OSGihttp://en.wikipedia.org/wiki/Incremental_compilerhttp://en.wikipedia.org/wiki/Refactorhttp://en.wikipedia.org/wiki/Metadatahttp://en.wikipedia.org/wiki/Relational_database_management_systemhttp://en.wikipedia.org/wiki/Relational_database_management_systemhttp://en.wikipedia.org/wiki/Mysql#cite_note-1http://en.wikipedia.org/wiki/Michael_Wideniushttp://en.wikipedia.org/wiki/Mysql#cite_note-2http://en.wikipedia.org/wiki/Mysql#cite_note-2http://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/Mysql#cite_note-3http://en.wikipedia.org/wiki/Mysql#cite_note-3http://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/GNU_General_Public_Licensehttp://en.wikipedia.org/wiki/GNU_General_Public_Licensehttp://en.wikipedia.org/wiki/Proprietary_softwarehttp://en.wikipedia.org/wiki/Proprietary_softwarehttp://en.wikipedia.org/wiki/Businesshttp://en.wikipedia.org/wiki/Swedenhttp://en.wikipedia.org/wiki/MySQL_ABhttp://en.wikipedia.org/wiki/MySQL_ABhttp://en.wikipedia.org/wiki/Oracle_Corporationhttp://en.wikipedia.org/wiki/Package_management_systemhttp://en.wikipedia.org/wiki/Package_management_systemhttp://en.wikipedia.org/wiki/PhpMyAdminhttp://en.wikipedia.org/wiki/Replication_(computer_science)#Database_replicationhttp://en.wikipedia.org/wiki/Hard_codehttp://en.wikipedia.org/wiki/Equinox_(OSGi)http://en.wikipedia.org/wiki/OSGihttp://en.wikipedia.org/wiki/Incremental_compilerhttp://en.wikipedia.org/wiki/Refactorhttp://en.wikipedia.org/wiki/Metadatahttp://en.wikipedia.org/wiki/Relational_database_management_systemhttp://en.wikipedia.org/wiki/Mysql#cite_note-1http://en.wikipedia.org/wiki/Michael_Wideniushttp://en.wikipedia.org/wiki/Mysql#cite_note-2http://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/Mysql#cite_note-3http://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/GNU_General_Public_Licensehttp://en.wikipedia.org/wiki/GNU_General_Public_Licensehttp://en.wikipedia.org/wiki/Proprietary_softwarehttp://en.wikipedia.org/wiki/Businesshttp://en.wikipedia.org/wiki/Swedenhttp://en.wikipedia.org/wiki/MySQL_ABhttp://en.wikipedia.org/wiki/Oracle_Corporationhttp://en.wikipedia.org/wiki/Package_management_systemhttp://en.wikipedia.org/wiki/PhpMyAdminhttp://en.wikipedia.org/wiki/Replication_(computer_science)#Database_replication
  • 8/3/2019 Training 2003

    12/44

    3

    2

    Data Query Language (DQL) Data Control Language (DCL) Data administration commands Transactional control commands

    Database Tables

    A database most often contains one or more tables. Each table is identified by a name (e.g."Customers" or "Orders"). Tables contain records (rows) with data.

    Below is an example of a table called "Persons":

    The table above contains three records (one for each person) and four columns (LastName,FirstName, Address, and City).

    Queries

    A query is a question or a request.

    With MySQL, we can query a database for specific information and have a recordset returned.

    Look at the following query:

    SELECT Last Name FROM Persons

    First Name Last Name Address City

    Abhishek Garg NIT Kurukshetra

    Vaibhav Nagpal DLF Colony Rohtak

    Navdeep Kaushik Saket Delhi

  • 8/3/2019 Training 2003

    13/44

    3

    2

    The query above selects all the data in the "LastName" column from the "Persons" table, and willreturn a recordset like this:

    LastName

    Garg

    Nagpal

    Kaushik

    Common Queries in MySql:

    To login (from unix shell) use -h only if needed.

    # [mysql dir]/bin/mysql -h hostname -u root -p

    Create a database on the sql server.

    mysql> create database [databasename];

    List all databases on the sql server.

    mysql> show databases;

    Switch to a database.

    mysql> use [db name];

    To see all the tables in the db.

    mysql> show tables;

    To see database's field formats.

    mysql> describe [table name];

    To delete a db.

    mysql> drop database [database name];

    To delete a table.

    mysql> drop table [table name];

    Show all data in a table.

  • 8/3/2019 Training 2003

    14/44

    3

    2

    mysql> SELECT * FROM [table name];

    Returns the columns and column information pertaining to the designated

    table.

    mysql> show columns from [table name];

    Show certain selected rows with the value "whatever".

    mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";

    Web Designing

    Web design is the process of planning and creating a website. Text, images, digital media andinteractive elements are used by web designers to produce the page seen on the web browser. Webdesigners utilize markup language, most notably HTML for structure and CSS for presentation andPHP for inducing various conditions in programming as well to addinteractivity to develop pages that

    can be read by web browsers.Ideally, web designers should strive to write code that is valid HTML and CSS. In doing so it

    makes it easier to correct problems, and edit pages. HTML and CSS are the fundamental

    technologies for building Web pages: HTML (html and xhtml) for structure, CSS for style and

    layout, including Web Fonts.By separating the presentation style of documents from the content

    of documents, CSS simplifies Web authoring and site maintenance. For example, having a

    separate CSS file allows for aesthetic changes to be made to the entire site rather than to just a

    single page. If CSS rules are included within a single HTML page, changes would have to be

    made to each and every page that used the element in question. The reasoning is that HTML

    should only be used for raw content and CSS be used to manipulate the content for aesthetic style.

    I have used 3 languages for Web Designing:

    HTML

    CSS

    PHP

    HTMLHTML is a language for describing web pages.

    HTML stands forHyperText Markup Language HTML is not a programming language, it is a markup language

    http://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/CSShttp://en.wikipedia.org/wiki/Interactivityhttp://en.wikipedia.org/wiki/Interactivityhttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/CSShttp://en.wikipedia.org/wiki/Interactivity
  • 8/3/2019 Training 2003

    15/44

    3

    2

    A markup language is a set ofmarkup tags HTML uses markup tags to describe web pages

    HTML is written in the form ofHTML elements consisting oftags, enclosed in angle brackets(like ), within the web page content. HTML tags most commonly come in pairs like and , although some tags, known as empty elements, are unpaired, for example . Thefirst tag in a pair is thestart tag, the second tag is the end tag(they are also called opening tagsand closing tags). In between these tags web designers can add text, tags, comments and other

    types of text-based content. HTML markup tags are usually called HTML tags

    HTML tags are keywords surrounded by angle brackets like HTML tags normally come in pairs like and The first tag in a pair is the start tag, the second tag is the end tag

    HTML elements form the building blocks of all websites. HTML allowsimages and objects to beembedded and can be used to createinteractive forms. It provides a means to createstructureddocuments by denoting structural semantics for text such as headings, paragraphs, lists, links,quotes and other items. It can embed scripts in languages such as JavaScript which affect thebehavior of HTML webpages.

    The purpose of a web browseris to read HTML documents and compose them into visible oraudible web pages. The browser does not display the HTML tags, but uses the tags to interpret thecontent of the page.

    HTML markup consists of several key components, including elements (and theirattributes),character-based data types, character references and entity references. Another importantcomponent is the document type declaration, which triggers standards mode rendering.

    TheHello world program, a common computer program employed for comparingprogramminglanguages, scripting languages and markup languages is made of 9 lines of code, although in

    HTML newlines are optional:

    Hello HTML

    Hello World!

    (The text between and describes the web page, and the text between and is the visible page content. The markup text 'Hello HTML' defines thebrowser tab title.)

    HTML can be written and edited using many different editors like Dreamweaver and VisualStudio.

    I have used a plain text editor (like Notepad) to edit HTML. We believe using a plain text editor isthe best way to learn HTML.

    http://en.wikipedia.org/wiki/HTML_elementhttp://en.wikipedia.org/wiki/Angle_bracketshttp://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Fieldsethttp://en.wikipedia.org/wiki/Fieldsethttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Semantichttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/JavaScripthttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Document_type_declarationhttp://en.wikipedia.org/wiki/Standards_modehttp://en.wikipedia.org/wiki/Hello_world_programhttp://en.wikipedia.org/wiki/Hello_world_programhttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Lines_of_codehttp://en.wikipedia.org/wiki/Newlinehttp://en.wikipedia.org/wiki/HTML_elementhttp://en.wikipedia.org/wiki/Angle_bracketshttp://en.wikipedia.org/wiki/Img_(HTML_element)http://en.wikipedia.org/wiki/Fieldsethttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Structured_documenthttp://en.wikipedia.org/wiki/Semantichttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/JavaScripthttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Document_type_declarationhttp://en.wikipedia.org/wiki/Standards_modehttp://en.wikipedia.org/wiki/Hello_world_programhttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Lines_of_codehttp://en.wikipedia.org/wiki/Newline
  • 8/3/2019 Training 2003

    16/44

    3

    2

    Core Attributesof HTML.

    Attribute Value Description

    class classnameSpecifies a classname for an

    element

    id id Specifies a unique id for an element

    style style_definition Specifies an inline style for anelement

    title textSpecifies extra information about an

    element

    COMMON HTML Tags:

    Tag Description

    Anchor. See introduction to HTML

    Content is shown as bold type

    The body part of the HTML document. See introductio to HTML


    Force line break within paragraph. Note that "floating elements" such as

    images are separate from the paragraph. To start next line below any

    images etc., use
    . The CLEAR attribute can takevalues "none", "right", "left", or "all" and is deprecated, but in fact still

    very useful. The best way to understand it is to try a few tests.

    Content is centred on page (can include paragraphs etc). Note American

    spelling.

    A dummy element which contains block-level elements. It is used with

    style sheets.

    Used to define characteristics of font, according to attributes e.g. SIZE,

    COLOR, FACE. SIZE sets size, 1-7 e.g. SIZE="5". COLOR sets colour of

    text e.g. makes text red. FACE e.g.

    FACE="Times".

    The head part of the HTML document

    http://www.w3schools.com/tags/att_standard_class.asphttp://www.w3schools.com/tags/att_standard_id.asphttp://www.w3schools.com/tags/att_standard_style.asphttp://www.w3schools.com/tags/att_standard_title.asphttp://www.thuto.org/ubh/web/html/html01.htm#linkshttp://www.thuto.org/ubh/web/html/tags1.htm#deprecated-defhttp://www.thuto.org/ubh/web/html/css01.htmhttp://www.w3schools.com/tags/att_standard_class.asphttp://www.w3schools.com/tags/att_standard_id.asphttp://www.w3schools.com/tags/att_standard_style.asphttp://www.w3schools.com/tags/att_standard_title.asphttp://www.thuto.org/ubh/web/html/html01.htm#linkshttp://www.thuto.org/ubh/web/html/tags1.htm#deprecated-defhttp://www.thuto.org/ubh/web/html/css01.htm
  • 8/3/2019 Training 2003

    17/44

    3

    2

    ...

    Headings (levels 1-6, i.e. H3 is a subheading within a H2 subheading).

    Draw horizontal line across page; used to indicate break between

    sections. Attributes: WIDTH, e.g. WIDTH="50%" makes line half size of

    page; SIZE, e.g. SIZE="3" makes line 3 pixels thick

    Italics.

    Image. Attributes: must have SRC and ALT. SRC gives source file for

    image, e.g. SRC="picture.jpg". ALT gives brief description e.g.

    ALT="Picture of UB"

    List item. Used within an ordered () or unordered () list

    Ordered list. Includes List Items, which will be numbered

    automatically

    Paragraph

    A dummy element which contains in-line content.

    Text is emphasised strongly - usually appears in bold.

    Subscript

    Superscript

    Table.

  • 8/3/2019 Training 2003

    18/44

    3

    2

    Table data cell.

    Table header cell.

    Title of document. This must appear in the part.

    Table row.

    Underline text. Use sparingly as it may be confused with hyperlinks

    Unordered List. Includes List Items, which will be displayed in a list

    with bullets.

    CSSCascading Style Sheets (CSS) is astyle sheet language used to describe thepresentationsemantics (the look and formatting) of a document written in a markup language. Its mostcommon application is to style web pages written in HTML and XHTML, but the language canalso be applied to any kind ofXML document, includingplain XML, SVG and XUL.

    CSS is designed primarily to enable the separation of document content (written in HTML or asimilar markup language) from document presentation, including elements such as the layout,colors, andfonts.[1] This separation can improve content accessibility, provide more flexibility andcontrol in the specification of presentation characteristics, enable multiple pages to shareformatting, and reduce complexity and repetition in the structural content (such as by allowing fortableless web design). CSS can also allow the same markup page to be presented in different stylesfor different rendering methods, such as on-screen, in print, by voice (when read out by a speech-based browser orscreen reader) and on Braille-based, tactile devices. While the author of adocument typically links that document to a CSS style sheet, readers can use a different stylesheet, perhaps one on their own computer, to override the one the author has specified.

    CSS specifies a priority scheme to determine which style rules apply if more than one rulematches against a particular element. In this so-called cascade, priorities orweights are calculatedand assigned to rules, so that the results are predictable.

    The CSS specifications are maintained by theWorld Wide Web Consortium (W3C)

    CSS has a simplesyntax and uses a number of English keywords to specify the names of variousstyle properties.

    http://en.wikipedia.org/wiki/Style_sheet_languagehttp://en.wikipedia.org/wiki/Style_sheet_languagehttp://en.wikipedia.org/wiki/Presentation_semanticshttp://en.wikipedia.org/wiki/Presentation_semanticshttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/XHTMLhttp://en.wikipedia.org/wiki/XMLhttp://en.wikipedia.org/wiki/Plain_Old_XMLhttp://en.wikipedia.org/wiki/Scalable_Vector_Graphicshttp://en.wikipedia.org/wiki/XULhttp://en.wikipedia.org/wiki/Page_layouthttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-0http://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-0http://en.wikipedia.org/wiki/Accessibilityhttp://en.wikipedia.org/wiki/Tableless_web_designhttp://en.wikipedia.org/wiki/Screen_readerhttp://en.wikipedia.org/wiki/Braillehttp://en.wikipedia.org/wiki/Tactilehttp://en.wikipedia.org/wiki/World_Wide_Web_Consortiumhttp://en.wikipedia.org/wiki/World_Wide_Web_Consortiumhttp://en.wikipedia.org/wiki/Syntaxhttp://en.wikipedia.org/wiki/Syntaxhttp://en.wikipedia.org/wiki/Style_sheet_languagehttp://en.wikipedia.org/wiki/Presentation_semanticshttp://en.wikipedia.org/wiki/Presentation_semanticshttp://en.wikipedia.org/wiki/Markup_languagehttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/XHTMLhttp://en.wikipedia.org/wiki/XMLhttp://en.wikipedia.org/wiki/Plain_Old_XMLhttp://en.wikipedia.org/wiki/Scalable_Vector_Graphicshttp://en.wikipedia.org/wiki/XULhttp://en.wikipedia.org/wiki/Page_layouthttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-0http://en.wikipedia.org/wiki/Accessibilityhttp://en.wikipedia.org/wiki/Tableless_web_designhttp://en.wikipedia.org/wiki/Screen_readerhttp://en.wikipedia.org/wiki/Braillehttp://en.wikipedia.org/wiki/Tactilehttp://en.wikipedia.org/wiki/World_Wide_Web_Consortiumhttp://en.wikipedia.org/wiki/Syntax
  • 8/3/2019 Training 2003

    19/44

    3

    2

    A style sheet consists of a list ofrules. Each rule or rule-set consists of one or moreselectors and adeclaration block. A declaration-block consists of a list ofdeclarations in braces. Each declarationitself consists of aproperty, a colon (:), a value. If there are multiple declarations in a block, a

    semi-colon (;) must be inserted to separate each declaration. [2]

    In CSS,selectors are used to declare which of the markup elements a style applies to, a kind ofmatch expression. Selectors may apply to all elements of a specific type, or only those elementsthat match a certain attribute; elements may be matched depending on how they are placed relative

    to each other in the markup code, or on how they are nested within the Document Object Model.

    Prior to CSS, nearly all of the presentational attributes of HTML documents were contained withinthe HTML markup; all font colors, background styles, element alignments, borders and sizes hadto be explicitly described, often repeatedly, within the HTML. CSS allows authors to move muchof that information to a separate style sheet resulting in considerably simpler HTML markup.

    Headings (h1 elements), sub-headings (h2), sub-sub-headings (h3), etc., are defined structurally

    using HTML. In print and on the screen, choice offont, size,colorandemphasis for these

    elements ispresentational.

    Prior to CSS, document authors who wanted to assign such typographic characteristics to, say, allh2 headings had to use the HTML font and other presentational elements for each occurrence of

    that heading type. The additional presentational markup in the HTML made documents morecomplex, and generally more difficult to maintain. In CSS, presentation is separated fromstructure. In print, CSS can define color, font, text alignment, size, borders, spacing, layout andmany other typographic characteristics. It can do so independently for on-screen and printedviews. CSS also defines non-visual styles such as the speed and emphasis with which text is readout by aural text readers. TheW3C now considers the advantages of CSS for defining all aspectsof the presentation of HTML pages to be superior to other methods. It has therefore deprecated the

    use of all the original presentational HTML markup.

    CSS files are inserted into HTML documents using the following syntax:

    Priority scheme for CSS sources (from highest to lowest priority):

    Author styles (provided by the web page author), in the form of:o Inline styles, inside the HTML document, style information on a single

    element, specified using the "style" attributeo Embedded style, blocks of CSS information inside the HTML itselfo External style sheets, i.e., a separate CSS file referenced from the

    document User style:

    o A local CSS file the user specifies with a browser option, which acts asan override applied to all documents

    User agent style

    http://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-1http://en.wikipedia.org/wiki/Document_Object_Modelhttp://en.wikipedia.org/wiki/Document_Object_Modelhttp://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Point_(typography)http://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Emphasis_(typography)http://en.wikipedia.org/wiki/Emphasis_(typography)http://en.wikipedia.org/wiki/Typographyhttp://en.wikipedia.org/wiki/W3Chttp://en.wikipedia.org/wiki/W3Chttp://en.wikipedia.org/wiki/Deprecationhttp://en.wikipedia.org/wiki/User_agenthttp://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-1http://en.wikipedia.org/wiki/Document_Object_Modelhttp://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Point_(typography)http://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Emphasis_(typography)http://en.wikipedia.org/wiki/Typographyhttp://en.wikipedia.org/wiki/W3Chttp://en.wikipedia.org/wiki/Deprecationhttp://en.wikipedia.org/wiki/User_agent
  • 8/3/2019 Training 2003

    20/44

    3

    2

    o Default styles applied by the user agent, i.e., the browser's defaultsettings for element presentation

    The style sheet with the highest priority controls the content display. Declarations not set in thehighest priority source are passed on by a source of lower priority such as the user agent style.This process is called cascading.

    The ideal way would be to give the user different options and transferring three different kinds of

    style sheets: one for printing, one for the presentation on the screen and one for the editor feature.

    One of the goals of CSS is also to allow users greater control over presentation. Someone whofinds red italic headings difficult to read may apply a different style sheet. Depending on theirbrowser and the web site, a user may choose from various style sheets provided by the designers,may remove all added style and view the site using the browser's default styling, or may overridejust the red italic heading style without altering other attributes. Unlike existing style languageslike DSSSL and FOSI, CSS allowed a document's style to be influenced by multiple style sheets.One style sheet could inherit or "cascade" from another, permitting a mixture of stylisticpreferences controlled equally by the site designer and user.

    Versions:

    Each level of CSS builds upon the last, typically adding new features and typically denoted asCSS1, CSS2, CSS3, and CSS4. Profiles are typically a subset of one or more levels of CSS builtfor a particular device or user interface. Currently there are profiles for mobile devices, printers,and television sets.

    CSS1

    The first CSS specification to become an official W3C Recommendation is CSS level 1, publishedin December 1996.[17] Among its capabilities are support for

    Font properties such as typeface and emphasis Color of text, backgrounds, and other elements Text attributes such as spacing between words, letters, and lines of text Alignment of text, images, tables and other elements Margin, border, padding, and positioning for most elements Unique identification and generic classification of groups of attributes

    CSS2

    CSS level 2 specification was developed by the W3C and published as a Recommendation in May1998. A superset of CSS1, CSS2 includes a number of new capabilities like absolute, relative, andfixed positioning of elements andz-index, the concept of media types, support for aural stylesheets and bidirectional text, and new font properties such as shadows.

    http://en.wikipedia.org/wiki/Document_Style_Semantics_and_Specification_Languagehttp://en.wikipedia.org/wiki/Formatting_Output_Specification_Instancehttp://en.wikipedia.org/wiki/Formatting_Output_Specification_Instancehttp://en.wikipedia.org/wiki/Inheritance_(computer_science)http://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-16http://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-16http://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Alignment_(typesetting)http://en.wikipedia.org/wiki/Table_(HTML)http://en.wikipedia.org/wiki/Z-indexhttp://en.wikipedia.org/wiki/Z-indexhttp://en.wikipedia.org/wiki/Document_Style_Semantics_and_Specification_Languagehttp://en.wikipedia.org/wiki/Formatting_Output_Specification_Instancehttp://en.wikipedia.org/wiki/Inheritance_(computer_science)http://en.wikipedia.org/wiki/Cascading_Style_Sheets#cite_note-16http://en.wikipedia.org/wiki/Typefacehttp://en.wikipedia.org/wiki/Alignment_(typesetting)http://en.wikipedia.org/wiki/Table_(HTML)http://en.wikipedia.org/wiki/Z-index
  • 8/3/2019 Training 2003

    21/44

    3

    2

    CSS 2.1

    CSS level 2 revision 1, often referred to as "CSS 2.1", fixes errors in CSS2, removes poorly-supported or not fully interoperable features and adds already-implemented browser extensions tothe specification. In order to comply with the W3C Process for standardizing technicalspecifications, CSS 2.1 went back and forth between Working Draft status and CandidateRecommendation status for many years. CSS 2.1 first became aCandidate Recommendation on

    February 25, 2004, but it was reverted to a Working Draft on June 13, 2005 for further review. Itreturned to Candidate Recommendation on 19 July 2007 and then updated twice in 2009.However, since changes and clarifications were made, it again went back to Last Call WorkingDraft on 7 December 2010.

    CSS3

    Unlike CSS2, a large single specification defining various features, CSS3 is divided into severalseparate documents called "modules". Each module adds new capability or extends featuresdefined in CSS2, over preserving backward compatibility. Work on CSS level 3 started around thetime of publication of the original CSS2 recommendation. The earliest CSS3 drafts werepublished in June 1999.

    There are two ways to CSS code into your page:

    1. By including link tag in the .aspx/.html page. Ideally this should be specified inside however you can place following code at any place of the page.

    In this case you need to specify the css code into MyClass.css file that should be kept in your

    root/default folder.

    2. By writing tag in the .aspx/.html page. Ideally this code should also be written inside tag, however you can write it at any place of the page.

    .myclass

    {/* write the code */}

    h1{/* write the code */}

    Common CSS Codes:To specify the border:

    border-left:1pxsolid#C1DEF9; /* to specify the left side border */

    http://www.w3.org/TR/2004/CR-CSS21-20040225/http://www.w3.org/TR/2004/CR-CSS21-20040225/http://www.w3.org/TR/2004/CR-CSS21-20040225/
  • 8/3/2019 Training 2003

    22/44

    3

    2

    border-top:1pxsolid#C1DEF9; /* to specify the top side border *

    border-bottom:2pxsolid#C1DEF9; /* to specify the bottom side border */

    border-right:0pxsolid#C1DEF9; /* to specify the right side border */

    Here 1px is the width of border solid is the border style and #XXXXXX is the color code, you canspecify valid color name too like Red, Green, Yellow etc.

    To specify height and width

    height:20px; /* height in pixel */

    width:20px; /* width in pixel */

    You can specify above attributes in either px (pixel), pt (point) or % (percentage).

    To specify background and foreground color

    background-color:#306C8F; /* background color or color code */

    color:White; /* foreground color or color code */

    To specify padding

    padding-left:5px; /* left side padding */

    padding-top:5px; /* top side padding */

    padding-left:5px; /* left side padding */

    padding-right:5px; /* right side padding */

    padding:5px; /* padding of all side */

    You can specify above attributes in either px (pixel), pt (point) or % (percentage).

    To specify font specific appearance

    font-family: Arial,TrebuchetMS,Tahoma,Verdana; /* specify font namesseparated by comma */

    font-size: 10pt; /* specify font size either in pt (point) or px (pixel) */

    font-style: normal; /* specify font style like italic or normal

    font-weight:bold; /* specify font weight like bold or bolder of specify anynumber */

    To specify margin

    margin-left:0px; /* specify left margin */

  • 8/3/2019 Training 2003

    23/44

    3

    2

    margin-top:0px; /* specify right margin */

    margin-bottom:5px; /* specify bottom margin */

    margin-right:10px; /* specify right margin */

    margin:5px; // specify margin from all side */

    You can specify above attributes in either px (pixel), pt (point) or % (percentage).

    To specfiy background image

    background-image:url(/images/menuBack_m.gif); /* specify the path of the image*/

    background-repeat: repeat-x; /* To repeat this image horizontally in background*/

    background-repeat: repeat-y; /* To repeat this image vertically in background*/

    To specity alignment

    text-align:center; /* align horizontally */

    vertical-align:bottom; /* align vertically */

    To float an element

    position:absolute; /* to float an element at its position */

    float: left; /* to float the element from its left */

    To hide and show

    display:none; /* hide the element */display: /* show the element */

    To specify for a particular element ID

    Lets say we want to apply a particular appearnce for a html element whose id is "div1" like thisMy text under this div . Here the name of the class

    will be the id of the element and will start from # (Hash).

    #div{font-color:red;}

    PHP

  • 8/3/2019 Training 2003

    24/44

    3

    2

    PHP is a general-purpose server-side scripting language originally designed forweb developmentto produce dynamic web pages. For this purpose, PHP code is embedded into the HTML sourcedocument and interpreted by a web serverwith a PHP processor module, which generates the webpage document. It also has evolved to include acommand-line interface capability and can be usedin standalonegraphical applications. PHP can be deployed on most web servers and as astandalone interpreter, on almost every operating system andplatform free of charge.[3] There isalso commercial software such as RadPHP, a rapid application developmentframeworkfor thePHP language.

    If your server supports PHP you don't need to do anything.Just create some .php files in your webdirectory, and the server will parse them for you. Because it is free, most web hosts offer PHPsupport.However, if your server does not support PHP, you must install PHP.

    PHP acts primarily as afilter,taking input from a file or stream containing text and/or PHPinstructions and outputting another stream of data; most commonly the output will be HTML. PHPhas a nativeBoolean type that is similar to the native Boolean types inJava and C++. Using theBoolean type conversion rules, non-zero values are interpreted as true and zero as false, as in Perland C++. The null data type represents a variable that has no value. The only value in the null datatype isNULL.Variables of the "resource" type represent references to resources from external

    sources. These are typically created by functions from a particular extension, and can only beprocessed by functions from the same extension; examples include file, image, and databaseresources.

    PHP script which sends the text "Hello World" to the browser:

    Arrays can contain elements of any type that PHP can handle, including resources, objects, andeven other arrays. Order is preserved in lists of values and in hashes with both keys and values,and the two can be intermingled. PHP also supports strings, which can be used with single quotesand double quotes.

    The Standard PHP Library (SPL) attempts to solve standard problems and implements efficientdata access interfaces and classes. PHP includes free and open source libraries with the core build.PHP is a fundamentallyInternet-aware system with modules built in for accessing FTP servers,

    many database servers, embedded SQL libraries such as embeddedPostgreSQL, MySQL andSQLite,LDAP servers, and others. Many functions familiar to C programmers such as those in thestdio family are available in the standard PHP build.[81]

    PHP allows developers to write extensions in C to add functionality to the PHP language. Thesecan then be compiled into PHP or loaded dynamically at runtime. Extensions have been written toadd support for the Windows API, process management onUnix-likeoperating systems, multibyte strings (Unicode)and several popularcompression formats. Some more unusual features

    http://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Web_developmenthttp://en.wikipedia.org/wiki/Dynamic_web_pagehttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/Web_serverhttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/Command-line_interfacehttp://en.wikipedia.org/wiki/Command-line_interfacehttp://en.wikipedia.org/wiki/Standalone_softwarehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Platform_(computing)http://en.wikipedia.org/wiki/Php#cite_note-foundations-2http://en.wikipedia.org/wiki/RadPHPhttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Software_frameworkhttp://en.wikipedia.org/wiki/Filter_(software)http://en.wikipedia.org/wiki/Filter_(software)http://en.wikipedia.org/wiki/Boolean_datatypehttp://en.wikipedia.org/wiki/Boolean_datatypehttp://en.wikipedia.org/wiki/Java_(programming_language)http://en.wikipedia.org/wiki/Java_(programming_language)http://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Perlhttp://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Hash_tablehttp://en.wikipedia.org/wiki/String_(computing)http://en.wikipedia.org/wiki/List_of_PHP_librarieshttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/File_transfer_protocolhttp://en.wikipedia.org/wiki/PostgreSQLhttp://en.wikipedia.org/wiki/PostgreSQLhttp://en.wikipedia.org/wiki/MySQLhttp://en.wikipedia.org/wiki/SQLitehttp://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocolhttp://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocolhttp://en.wikipedia.org/wiki/Stdio.hhttp://en.wikipedia.org/wiki/Php#cite_note-80http://en.wikipedia.org/wiki/Extension_(computing)http://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Windows_APIhttp://en.wikipedia.org/wiki/Unix-likehttp://en.wikipedia.org/wiki/Unix-likehttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Unicodehttp://en.wikipedia.org/wiki/Archive_formathttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Web_developmenthttp://en.wikipedia.org/wiki/Dynamic_web_pagehttp://en.wikipedia.org/wiki/HTMLhttp://en.wikipedia.org/wiki/Web_serverhttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/Web_pagehttp://en.wikipedia.org/wiki/Command-line_interfacehttp://en.wikipedia.org/wiki/Standalone_softwarehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Platform_(computing)http://en.wikipedia.org/wiki/Php#cite_note-foundations-2http://en.wikipedia.org/wiki/RadPHPhttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Software_frameworkhttp://en.wikipedia.org/wiki/Filter_(software)http://en.wikipedia.org/wiki/Boolean_datatypehttp://en.wikipedia.org/wiki/Java_(programming_language)http://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Perlhttp://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Hash_tablehttp://en.wikipedia.org/wiki/String_(computing)http://en.wikipedia.org/wiki/List_of_PHP_librarieshttp://en.wikipedia.org/wiki/Internethttp://en.wikipedia.org/wiki/File_transfer_protocolhttp://en.wikipedia.org/wiki/PostgreSQLhttp://en.wikipedia.org/wiki/MySQLhttp://en.wikipedia.org/wiki/SQLitehttp://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocolhttp://en.wikipedia.org/wiki/Stdio.hhttp://en.wikipedia.org/wiki/Php#cite_note-80http://en.wikipedia.org/wiki/Extension_(computing)http://en.wikipedia.org/wiki/C_(programming_language)http://en.wikipedia.org/wiki/Windows_APIhttp://en.wikipedia.org/wiki/Unix-likehttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Unicodehttp://en.wikipedia.org/wiki/Archive_format
  • 8/3/2019 Training 2003

    25/44

    3

    2

    include integration withInternet Relay Chat, dynamic generation of images and Adobe Flashcontent, and even speech synthesis. ThePHP Extension Community Library (PECL) project is arepository for extensions to the PHP language.

    Naming Rules for Variables

    A variable name must start with a letter or an underscore "_" A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9,

    and _ ) A variable name should not contain spaces. If a variable name is more than one word, it

    should be separated with an underscore ($my_string), or with capitalization ($myString) String variables are used for values that contain characters. After we create a string we can manipulate it. A string can be used directly in a function or

    it can be stored in a variable.

    PHP language was originally implemented as aninterpreter. Several compilers have beendeveloped which decouple the PHP language from the interpreter. Advantages of compilationinclude better execution speed, static analysis, and improved interoperability with code written inother languages.[80] PHP compilers of note includePhalanger, which compiles PHP into CIL byte-

    code, and HipHop, developed at Facebook and now available as open source, which transformsthe PHP Script into C++, then compiles it, reducing server load up to 50%.

    Implementing The Learning

    All of the above said languages and concepts were used to prepare a offline software to implementa referral system which gives referral points to the user who will make a valid refer,the pointscould be used to avail certain discounts and an Application on Facebook which would take certain

    parameters as input and will automatically give a AD format which is similar to the classifiedspublished in Newspapers.

    Referral System using JAVA and JDBC-:

    import java.io.*;

    import java.sql.*;

    public class StringReader {

    static String username = "myadcorner";

    static String password = "gungun";

    static String tablename = "CLIENTDB";

    static String tablename2="REFERRALS";

    static String fieldname = "CLIENTID";

    static String fieldname2 ="USERNAME";

    static String fieldname3="REFERS";

    static String fieldname4="REFERRERID";

    http://en.wikipedia.org/wiki/Internet_Relay_Chathttp://en.wikipedia.org/wiki/Internet_Relay_Chathttp://en.wikipedia.org/wiki/Adobe_Flashhttp://en.wikipedia.org/wiki/Speech_synthesishttp://en.wikipedia.org/wiki/PHP_Extension_Community_Libraryhttp://en.wikipedia.org/wiki/PHP_Extension_Community_Libraryhttp://en.wikipedia.org/wiki/Interpreter_(computing)http://en.wikipedia.org/wiki/Interpreter_(computing)http://en.wikipedia.org/wiki/PHP#cite_note-79http://en.wikipedia.org/wiki/PHP#cite_note-79http://en.wikipedia.org/wiki/Phalanger_(compiler)http://en.wikipedia.org/wiki/Phalanger_(compiler)http://en.wikipedia.org/wiki/Common_Intermediate_Languagehttp://en.wikipedia.org/wiki/HipHop_for_PHPhttp://en.wikipedia.org/wiki/C%2B%2Bhttp://en.wikipedia.org/wiki/Internet_Relay_Chathttp://en.wikipedia.org/wiki/Adobe_Flashhttp://en.wikipedia.org/wiki/Speech_synthesishttp://en.wikipedia.org/wiki/PHP_Extension_Community_Libraryhttp://en.wikipedia.org/wiki/Interpreter_(computing)http://en.wikipedia.org/wiki/PHP#cite_note-79http://en.wikipedia.org/wiki/Phalanger_(compiler)http://en.wikipedia.org/wiki/Common_Intermediate_Languagehttp://en.wikipedia.org/wiki/HipHop_for_PHPhttp://en.wikipedia.org/wiki/C%2B%2B
  • 8/3/2019 Training 2003

    26/44

    3

    2

    static String fieldname5="TOTALPOINTS";

    static String fieldname6="CONVERTED";

    static String url = "jdbc:mysql://localhost:3306/" + username;

    static String client_name;

    //method to insert new client information

    public void insert_information() throws ClassNotFoundException,SQLException

    {String clientname="";

    int id=0,check=1;

    InputStreamReader input = new InputStreamReader(System.in);

    BufferedReader reader = new BufferedReader(input);

    Class.forName("com.mysql.jdbc.Driver");

    Connection con,con1,con2;

    Statement stmt,stmt1,stmt2;con= DriverManager.getConnection(url, username, password);

    con1=con;

    con2=con1;

    stmt = con.createStatement();

    stmt1 = con1.createStatement();

    stmt2 = con2.createStatement();

    while(check!=0)

    {System.out.println("Enter Unique UserName");try

    { clientname = reader.readLine(); }

    catch(Exception e){}

    String query="SELECT " + fieldname+ " FROM " + tablename +" WHERE "+fieldname2+" ='"+clientname+ "';";

    ResultSet rs1 = stmt2.executeQuery(query);

    check=0;

    while (rs1.next()) {

    check= rs1.getInt(1);

    }}

    stmt.executeUpdate("INSERT INTO "+tablename+ " VALUES(null,'" +clientname+ "',0,0);");

    System.out.println("Your Details:");

    System.out.println("USERNAME "+clientname);

  • 8/3/2019 Training 2003

    27/44

    3

    2

    String query1="SELECT "+fieldname+" FROM "+tablename+" WHERE "+fieldname2+" ='"+clientname+"' ; ";

    ResultSet rs = stmt1.executeQuery(query1);

    System.out.println("Customer Id ");

    while (rs.next()) {

    id = rs.getInt(1);

    }System.out.print(id);

    con.close();

    con1.close();

    con2.close();

    stmt.close();

    stmt1.close();

    stmt2.close();

    }//method to insert email id in referral table

    public void insertreferrls(String a,int cid) throws ClassNotFoundException,SQLException

    {

    Class.forName("com.mysql.jdbc.Driver");

    Connection con;

    Statement stmt;

    con= DriverManager.getConnection(url, username, password);

    stmt = con.createStatement();

    stmt.executeUpdate("INSERT INTO "+tablename2+ " VALUES("+cid+",'"+a+"',0);");

    con.close();

    stmt.close();

    }

    //method to check if the referrer info is true or not

    public int checkreferral(int a,String b) throwsIOException,ClassNotFoundException,SQLException {

    String query="SELECT " + fieldname3+ " FROM " + tablename2 +" WHERE"+fieldname4+" = "+a+ ";";

    String query1="SELECT " + fieldname6+ " FROM " + tablename2 +" WHERE"+fieldname3+" = '"+b+ "';";

    int ab=0,status=0;

    String c=b,abc="";

    Class.forName("com.mysql.jdbc.Driver");

    Connection con,con1;

    Statement stmt,stmt1;

  • 8/3/2019 Training 2003

    28/44

    3

    2

    con= DriverManager.getConnection(url, username, password);

    con1=con;

    stmt = con.createStatement();

    stmt1 = con1.createStatement();

    ResultSet rs = stmt.executeQuery(query);

    ResultSet rs1 = stmt1.executeQuery(query1);

    while (rs1.next()) {

    status = rs1.getInt(1); }

    while (rs.next())

    { abc=rs.getString(1);}

    if (status==0)

    {

    if(abc.equals(c))

    {

    System.out.println("REFERRAL FOUND");System.out.println("1 Refer Point is added to Cutomer id="+a);

    ab= 1;

    }

    else

    { System.out.println("Sorry No Such Customer found ");

    ab= 0;}

    }

    else{System.out.println(" You Have Already Submitted a referrer id");}

    con.close();

    con1.close();

    stmt.close();

    stmt1.close();

    return ab;

    }

    //method to add points to refferral points

    public void addpoints(int a,int b) throws IOException,ClassNotFoundException,SQLException

    { Class.forName("com.mysql.jdbc.Driver");

  • 8/3/2019 Training 2003

    29/44

    3

    2

    Connection con= DriverManager.getConnection(url, username, password);

    Connection con1=con;

    Connection con2=con;

    Statement stmt,stmt1,stmt2;

    stmt= con.createStatement();

    stmt1 = con1.createStatement();

    stmt2 = con2.createStatement();

    if (b==1)

    {

    stmt.executeUpdate(" UPDATE "+tablename+" set "+fieldname3+" = "+fieldname3+" + 1"+" WHERE "+fieldname+" = "+a+";");

    stmt1.executeUpdate(" UPDATE "+tablename+" set "+fieldname5+" = "+fieldname5+" +100 "+" WHERE "+fieldname+" = "+a+";");

    stmt2.executeUpdate(" UPDATE "+tablename2+" set "+fieldname6+" = 1 "+" WHERE

    "+fieldname4+" = "+a+";");

    }

    else

    {}

    con.close();

    con1.close();

    stmt.close();

    stmt1.close();stmt2.close();

    }

    public static void main (String[] args) throwsIOException,ClassNotFoundException,SQLException

    { StringReader s=new StringReader();

    String string = "",email="",choice="",test="yes";

    InputStreamReader input = new InputStreamReader(System.in);

    BufferedReader reader = new BufferedReader(input);

    // read in user input

    System.out.println("Want to Sign in?(yes/no)");

    try

    { choice = reader.readLine();

  • 8/3/2019 Training 2003

    30/44

    3

    2

    }

    catch(Exception e){}

    if(choice.equals(test))

    {s.insert_information();

    System.out.println(" ");

    System.out.println("Were you Referred By someone?(yes/no)");

    try

    { choice = reader.readLine();

    }

    catch(Exception e){}

    if(choice.equals(test))

    {

    System.out.println("Enter the customer id of your referrer");

    String stringint1 = reader.readLine();

    int value1 = Integer.parseInt(stringint1);System.out.println("Enter Yor Email ID");

    try

    { email = reader.readLine();

    }

    catch(Exception e){}

    int chckref=s.checkreferral(value1,email);

    s.addpoints(value1,chckref);

    }else {}}

    else

    {}

    System.out.println("Do you want to refer someone(yes/no)");

    try

    { choice = reader.readLine();

    }

    catch(Exception e){}

    if(choice.equals(test))

    { System.out.println("Enter your id");

    String stringint = reader.readLine();

    int value = Integer.parseInt(stringint);

    System.out.println("Enter the Email Id to be referred");

  • 8/3/2019 Training 2003

    31/44

    3

    2

    try

    { string = reader.readLine();

    }

    catch(Exception e){}

    System.out.println("You typed: " + string);

    System.out.println("Sending Email to "+ string+"..... ");

    //after this the email are sent to the given email id

    System.out.println("Thanx for visiting");

    s.insertreferrls(string,value);

    }

    else

    System.out.println("Thanx for Visiting");

    }

    }

    Application on Facebook

  • 8/3/2019 Training 2003

    32/44

    3

    2

    $token_url = "https://graph.facebook.com/oauth/access_token?client_id="

    . $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret="

    . $app_secret . "&code=" . $code;

    // request access token

    //use curl and not file_get_contents()

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_setopt($ch, CURLOPT_URL, $token_url);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_TIMEOUT, 30);

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

    $access_token = curl_exec($ch);curl_close($ch);

    $graph_url = "https://graph.facebook.com/me?access_token=".$access_token;

    // request user data using the access token

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_HEADER, 0);

    curl_setopt($ch, CURLOPT_URL, $graph_url);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_TIMEOUT, 30);

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);

    $temp_user = curl_exec($ch);

    curl_close($ch);

    //decode the json array to get user data

    $user =mixed json_decode($temp_user);

    //store user data

    $u = $user->name;

    $e = $user->email;

    $fb_id = $user->id;

    $uname = $user->username;

  • 8/3/2019 Training 2003

    33/44

    3

    2

    */?>

    AD Composer

    // Load the Google Transliterate API

    google.load("elements", "1", {

    packages: "transliteration"

    });

  • 8/3/2019 Training 2003

    34/44

    3

    2

    function onLoad() {

    var options = {

    sourceLanguage:

    google.elements.transliteration.LanguageCode.ENGLISH,

    destinationLanguage:

    [google.elements.transliteration.LanguageCode.HINDI],

    shortcutKey: 'ctrl+g',

    transliterationEnabled: true

    };

    // Create an instance on TransliterationControl with the required

    var control =

    new google.elements.transliteration.TransliterationControl(options);

    var ids = [ "transl1" ];

    control.makeTransliteratable(ids); }google.setOnLoadCallback(onLoad);

    var _gaq = _gaq || [];

    _gaq.push(['_setAccount', 'UA-18133582-1']);

    _gaq.push(['_setDomainName', '.myadcorner.com']);

    _gaq.push(['_trackPageview']);function() {

    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

    })();

    function submitform()

    {document.myform.submit();}

    function submitSearchformFromImg(adCat)

    { var form = document.myform;

    form.Advertisement.value = adCat;

    form.submit();}

  • 8/3/2019 Training 2003

    35/44

    3

    2

    function submitform1()

    {document.myform1.submit();}

    Ad-Composer Tool - Compose your newspaper

    advertisements

    Select Category

    select your ad category

  • 8/3/2019 Training 2003

    36/44

    3

    2

  • 8/3/2019 Training 2003

    37/44

    3

    2

    { ?>






    Profile Info

    Profile

  • 8/3/2019 Training 2003

    38/44

    3

    2

    ?>" size="12"/>

    Exp. Required

  • 8/3/2019 Training 2003

    39/44

    3

    2

    Address

  • 8/3/2019 Training 2003

    40/44

    3

    2

    $add=$_POST['address'];

    $phno=$_POST['phno'];

    $email=$_POST['email'];

    $cname=$_POST['cname'];

    $vacancy=$_POST['vacancy']?>

    Sample Ad 1

    Sample Ad 2

    Sample Ad 3

  • 8/3/2019 Training 2003

    41/44

    3

    2

    print(",".$sal);

    }

    else{print(",".$sal." with ".$inc);

    }}

    if(($email==null)||($email=="")){}

    else {print(",em:".$email);}

    if(($add==null)||($add=="")){}

    else {print(",".$add);}

    if(($phno!=null)||($phno!=""))

    {print(" #".$phno);

    }}

    ?>

  • 8/3/2019 Training 2003

    42/44

    3

    2

    else{print(" ".$sal." with ".$inc);}}

    if(($email==null)||($email=="")){}

    else {print(",em:".$email);}

    if(($add==null)||($add=="")){}

    else {print(",".$add);}

    if($phno==null){}

    else{print(" #".$phno);

    }}?>

  • 8/3/2019 Training 2003

    43/44

    3

    2

    else {print(" for ".$cname);}

    if(($add==null)||($add=="")){}

    else {print(",".$add);}

    if($phno==null){}

    else{print(" #".$phno);

    }}

    ?>

    Book Newspaper adnow |

    AdRates |

    ContactUs |

    Advertising Tips

    - powered by www.myadcorner.com

    Times of India | Hindustan Times | The Hindu | Navbharat Times | Mumbai Mirror |Pune Mirror | Bangalore Mirror | Hindustan Hindi | Economic Times | Rajasthan Patrika |Dainik Bhaskar | The Tribune | Dainik Jagran | Amar Ujala

  • 8/3/2019 Training 2003

    44/44