google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.

Wednesday, July 23, 2014

Java

Java Programming Language:

 Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java applications are typically compiled to byte-code (class file) that can run on any Java virtual machine (JVM) regardless of computer architecture. Java is, as of 2014, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers.
Figure :-Java Logo 

Java is:

Architectural-neutral: Java compiler generates an architecture-neutral object file format which makes the compiled code to be executable on many processors, with the presence of Java run-time system.

Distributed: Java is designed for the distributed environment of the internet.

Dynamic: Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on run-time.

High Performance: With the use of Just-In-Time compilers, Java enables high performance.

Interpreted: Java byte code is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light weight process.

Multi-threaded: With Java's multi-threaded feature it is possible to write programs that can do many tasks simultaneously. This design feature allows developers to construct smoothly running interactive applications.

Object Oriented: In Java, everything is an Object. Java can be easily extended since it is based on the Object model.

Platform independent: Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by virtual Machine (JVM) on whichever platform it is being run.
 

Portable: Being architectural-neutral and having no implementation dependent aspects of the specification makes Java portable. Compiler in Java is written in ANSI C with a clean portability boundary which is a PO SIX subset.

Robust: Java makes an effort to eliminate error prone situations by emphasizing mainly on compile time error checking and run-time checking.

Secure: With Java's secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption.

Simple: Java is designed to be easy to learn. If you understand the basic concept of OOP Java would be easy to master.


History of Java:
James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects. The language, initially called Oak after an oak tree that stood outside Gosling's office, also went by the name Green and ended up later being renamed as Java, from a list of random words.
Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms.
On 13 November 2006, Sun released much of Java as free and open source software under the terms of the GNU General Public License (GPL).
On 8 May 2007, Sun finished the process, making all of Java's core code free and open-source, aside from a small portion of code to which Sun did not hold the copyright.


Software:
Linux 7.1 or Windows 95/98/2000/XP/7/8 operating system.
Java JDK 5
Microsoft Notepad or any other text editor

Java programming language was originally developed by Sun Micro-systems which was initiated by James Gosling and released in 1995 as core component of Sun Micro-systems Java platform (Java 1.0 [J2SE]).

As of December 2008, the latest release of the Java Standard Edition is 6 (J2SE).
With the advancement of Java and its widespread popularity, multiple configurations were built to suite various types of platforms. Ex: J2EE for Enterprise Applications, J2ME for Mobile Applications.

Sun Micro-systems has renamed the new J2 versions as Java SE, Java EE and Java ME respectively.
Java is guaranteed to be Write Once, Run Anywhere.
 

Tuesday, July 22, 2014

PHP

PHP

  1. PHP is a recursive acronym for "Hypertext Preprocessor".
  2. PHP is a widely-used, open source scripting language.
  3. PHP scripts are executed on the server.
  4. PHP costs nothing, it is free to download and use.
  5. PHP files can contain text, HTML, CSS, JavaScript, and PHP code.
  6. PHP code are executed on the server, and the result is returned to the browser as plain HTML.
  7. PHP files have extension ".php".
  8. PHP can generate dynamic page content.
  9. PHP can create, open, read, write, delete, and close files on the server.
  10. PHP can collect form data.
  11. PHP can send and receive cookies.
  12. PHP can add, delete, modify data in your database.
  13. PHP can restrict users to access some pages on your website.
  14. PHP can encrypt data.
  15. PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.).
  16. PHP is compatible with almost all servers used today (Apache, IIS, etc.).
  17. PHP supports a wide range of databases.
  18. PHP is easy to learn and runs efficiently on the server side.
  19. With PHP you are not limited to output HTML. You can output images, PDF files, and even Flash movies.
  20. You can also output any text, such as XHTML and XML.
  21. In PHP, all user-defined functions, classes, and keywords (e.g. if, else, while, echo, etc.) are NOT case-sensitive.However; in PHP, all variables are case-sensitive.
  22. PHP is a Loosely Typed Language.PHP automatically converts the variable to the correct data type, depending on its value.In other languages such as C, C++, and Java, the programmer must declare the name and type of the variable before using it.


PHP Variables:-

As with algebra, PHP variables can be used to hold values (x=5) or expressions (z=x+y).

A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume).

Rules for PHP variables:
  1. A variable starts with the $ sign, followed by the name of the variable
  2. A variable name must start with a letter or the underscore character
  3. A variable name cannot start with a number
  4. A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  5. Variable names are case sensitive ($y and $Y are two different variables)



PHP Variables Scope:-

In PHP, variables can be declared anywhere in the script.

The scope of a variable is the part of the script where the variable can be referenced/used.

PHP has three different variable scopes:
  1. local
  2. global
  3. static

PHP Data Types:-
PHP Integers:

An integer is a number without decimals.

Rules for integers:

  1. An integer must have at least one digit (0-9)
  2. An integer cannot contain comma or blanks
  3. An integer must not have a decimal point
  4. An integer can be either positive or negative
  5. Integers can be specified in three formats: decimal (10-based), hexadecimal (16-based - prefixed with 0x) or octal (8-based - prefixed with 0)

Example
<?php
$x = 5985;
var_dump($x);
echo "<br>";
$x = -345; // negative number
var_dump($x);
echo "<br>";
$x = 0x8C; // hexadecimal number
var_dump($x);
echo "<br>";
$x = 047; // octal number
var_dump($x);
?>

Basic PHP Syntax:-
A PHP script can be placed anywhere in the document.
A PHP script starts with <?php and ends with ?>

Example:

<!DOCTYPE html>
<html>
<body>

<h1>My first PHP page</h1>

<?php
echo "Hello World!";
?>

</body>
</html>

PHP statements are terminated by semicolon (;).
The closing tag of a block of PHP code also automatically implies a semicolon.
So you do not have to have a semicolon terminating the last line of a PHP block.

अच्छे विचार करे विचार

  पहचान की नुमाईश, जरा कम करें... जहाँ भी "मैं" लिखा है, उसे "हम" करें... हमारी "इच्छाओं" से ज़्यादा "सुन...