October 5, 2010

Microsoft Second Shot Offer Gifted With Humongous Discounts

Great news and a golden chance from Microsoft for all aspirants who are planning to take Microsoft Certification exams. Now Microsoft has announced the Second Shot offer by which a candidate can get a free retake of the exam if he/she does not pass an IT Professional or developer Microsoft Certification exam in the first time. Microsoft second shot offer also includes huge discount on various exam pack decided by Microsoft.

Microsoft is providing various certification packs. You can checkout the exam packs and discounts in the following list:

Certification packs
Savings
Second Shot Offer
5-exam pack
20%
Included with each exam
4-exam pack
20%
Included with each exam
3-exam pack
15%
Included with each exam
2-exam pack
15%
Included with each exam
1-exam
Regular price
Add 15% to single exam price*

You can choose your exam pack and get your voucher code from Prometric by the following link:
Choose your exam pack and get your voucher code

You can get full details on this news by clicking here:
Read more >> Share/Bookmark

October 2, 2010

Adobe Flex 4 Exam (9A0-129) released

Adobe has released new Adobe Flex 4 ACE (9A0-129 Exam). This exam is the new version of Flex 3 (9A0-082 exam). The 9A0-129 ACE examination is developed for designers, web applications developers, and other programming experts. The Flex 4 ACE exam consists of 59 multiple-choice questions and it costs approximately $150.

You can register for this exam from Pearson VUE.

A candidate who is preparing for this exam must thoroughly prepare these objectives specified by Adobe :
  • Identifying and describe the basic UI controls
  • Creating and using custom components 
  • Using the ActionSript programming 
  • Implementing data validation and manipulate XML data by using E4X 
  • Implementing simple LiveCycle Data Services (LCDS) messaging and data management 
  • Using the Adobe Integrated Runtime (AIR)
For more details regarding this exam you can visit official Adobe Flex exam page.


.
Read more >> Share/Bookmark

April 13, 2010

What is the RegExpValidator class in Adobe Flex 3?


The RegExpValidator class enables a programmer to use  a regular expression for validating a field. You pass a regular expression to the validator by using the expression property, and additional flags to control the regular expression pattern matching by using the flags property. The process of the validation becomes successful when the validator finds a match of the regular expression in the field to validate; otherwise, an error occurs.


It is used to dispatch the valid and invalid events. The event object is an instance for an invalid event of the validationResultEvent class. It holds an array of validationResult objects. doValidation() is a protected method of the RegExpValidator class. It is used to override of the base class doValidation() method to validate a regular expression. Following are the public properties of the RegExpValidator class:
  • expression: It is used for validation.
  • flags: It is used when the validator finds a match.
  • noExpressionError: It is an error message. It occurs when there is no regular expression specified.
  • noMatchError: It is an error message. It occurs when there are no matches to the regular expression.



Read more >> Share/Bookmark

April 12, 2010

Learn All About Adobe Flex 3 with AIR 9A0-082 Certification Exam and its Benefits


Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform. The Flex platform has dominant media players that support rich media. Besides that, Adobe Flex is also lighter and works without being installed. It also creates SWF files rendered by the Adobe Flash Player. The 9A0-082 Adobe Certified Expert (ACE) certification is developed for programmers, web applications developers, and other development professionals who want to demonstrate proficiency with single or multiple Adobe products.

Key Objectives of the exam
This certification exam mainly tests your ability in the following areas:

1. Creating a User Interface (UI)
This objective primarily focuses on the following sub objectives:

  • Identify and describe the basic UI controls used in a Flex application and identify the purpose of UI containers and when to use them.

  • Change the look and feel of a design by using API styles, style sheets, filters, blends and dynamically change the look of an application by using view states, transitions, and effects.

  • Position UI elements by using constraint-based layout and enhanced constraints.

  • Implement application navigation by using navigator containers and customize list-based controls.

2. Flex system architecture and design
This objective primarily focuses on the following sub objectives:

  • Create and use custom components and transfer data between components by using data bindings.
  • Create, handle, and dispatch custom events and handle framework events.
  • List and describe the differences between model, view, and controller code in a Flex application.

3. Programming Flex applications with ActionScript
This objective primarily focuses on the following sub objectives:

  • Define and extend an ActionScript class, implement an ActionScript interface and use access modifiers with classes and class members.
  • Under the purpose of and implement data transfer objects, implement accessor methods in ActionScript and use an ArrayCollection to sort, filter, and provide data.
  • Implement data validation and manipulate XML data by using E4X.

4. Interacting with data sources and servers
This objective primarily focuses on the following sub objectives:

  • Implement simple LiveCycle Data Services (LCDS) messaging and data management.
  • Create, connect to, and define a local database and add, update, and remove records from local database.
  • Interact with remote data and services by using Remote Procedure Call (RPC) services and upload files to a server.

5. Using Flex in the Adobe Integrated Runtime (AIR)
This objective primarily focuses on the following sub objectives:

  • Given a scenario, compile, export a release build of an AIR application and create, populate, delete files and directories on a local file system.
  • Create and customize native windows, menus, and adding drag-and-drop functionality to and from the desktop.
  • Install, uninstall, and update an AIR application and list, describe the AIR security contexts.

Number of Questions
The exam consists of 50 multiple-choice questions. The 9A0-082 exam is in linear format.

How much I have to score to pass the exam?
You have to score 67% to pass the exam.

Duration of the Exam
The duration of the 9A0-082 exam is 85 minutes.

Are there any Pre-Requisites for the 9A0-082 Adobe Flex 3 With AIR exam?
The candidates who wish to take this Adobe Flex 3 with AIR exam, they have to take only one test, i.e., 9A0-082 exam to achieve the Adobe Flex 3 certification. Although there are no prerequisites for this certification, it would be helpful if they have hands on experience using the Adobe Flex 3.


Why should I earn Adobe Flex 3 (9A0-082) Certification ?
There are numerous advantages of becoming a Adobe Flex 3 Certification. I can cover some key points here:
  •  Adobe Flex 3 is most broadly and openly used technology in the current era and the 9A0-082 certification approves your expertise on the Flex 3 products and technology.
  • Candidates who are already earned  the Adobe Flex 3 With AIR (9A0-082) certification are considered as top favorites by the employers and also the No.1 choice for the job and they also get preference in promotions.                                                                                                                                                                           
  • Adobe Flex 3 provides a vast range of facilities to its users, such as allowing a user to choose different containers and layout managers to lay out contents, and uses different types of panels and windows.                                                                                                                                                                                                   
  • Adobe Flex 3 technology provides a wider area of safe and secure jobs from Adobe Flex Developer, Adobe Flex Coder, Senior Software Systems Engineer – Adobe Flex with ActionScript 3.0, ADOBE FLEX ARCHITECT, Adobe Flex Programmer to LiveCycle Developer III.                                                                                              
  • This versatile certification provides you prospects for a variety of job roles and you have to just pass just one test i.e. 9A0-082 to achieve this certification.
How Much Is The Exam Fees?
The Fee for taking Adobe Flex 3 with AIR 9A0-082 exam is US$150.

Where To Take The Exam?
The candidates may get register themselves at Pearson VUE testing center to take the exam. After you purchase your exam voucher, you can contact an authorized Pearson VUE center to schedule your exam date, time, and location. You can book the exam within one year from the date of purchase of the voucher. The exam date may depend on your choice (and availability of slot) in your selected test center.

What is the exam retake policy?
If you do not pass in the 9A0-082 exam, you will have to purchase a new exam voucher to retake the exam. There is no wait time fixed between the two attempts.

Read more >> Share/Bookmark

April 10, 2010

Important Functions of PHP


A function is a set of actions defined by a user, which affects one or more objects as per the definition. The function block starts with the function keyword. Functions, once created, can be reused in other parts of the document. The syntax for defining a function is as follows:

function functionname()
{
  ..
  ....
  .......
}

Some important function are listed below:

array_slice() function

The array_slice() function is used to extract a large piece of an array. The syntax of the array_slice() function is as follows:

array array_slice ( array $array , int $offset [, int $length [, bool $preserve_keys = false ]] )

the parameter can be defined as,


Option


Description

array

It is the input array.

offset

If offset is positive, the sequence starts from that offset in the array. If offset is negative, the sequence starts from the end of the array.

length

If the length is omitted, array_slice() assumes that the user wants all elements from the starting position onward returned.

preserve_keys

When this option is used, array_slice() preserves the keys and does not reorder them.

array_shift() function

The array_shift() function is used to remove and return the first element of an array passed to it as an argument. It is used mainly to create a queue and act on it until the queue is empty. The array_shift() function either returns the shifted value of an array, or returns the NULL value if array is empty or argument passed is not an array.

array_merge() function
The array_merge() function is used to merge two or more arrays by combining all their elements. If the input arrays have the same index keys, the later value for that key overwrites the previous one. If arrays contain keys in numeric form, the later value for that key appends the index keys instead of overwriting it.

array_intersect() function
The array_intersect() function extracts all the elements that are common for two or more arrays. Since this function only checks whether the values are the same, the index keys of arrays are ignored. Let's take an example to understand this:

<?php
$array1 = array ('a' => 20, 30, 35);
$array2 = array ('b' => 20, 35, 30);
$array = array_intersect($array1, $array2);
var_dump ($array);
? >

The output of the above script will be array(3) { ["'a'"]=> int(20) [0]=> int(30) [1]=> int(35) } since three elements (20, 30, 35) are common in both arrays, i.e., $array1 and $array2.

sort() function
The sort() function is used to sort a given array either alphabetically if any strings are present or numerically if all elements are numbers. However, a user cannot pass an associative array to the sort() function. The reason behind this is that the values of the array are sorted as expected but keys are replaced by numerical indices that follow the sort order.

asort() function
The asort() function accepts an associative array and sorts its values either alphabetically if any strings are present or numerically if all elements are numbers. However, the asort() function preserves the array keys.

ksort() function
The ksort() function accepts an associative array and sorts its keys either alphabetically if any strings are present, or numerically if all elements are numbers. However, it does not sort the elements of the associative array.



 
Read more >> Share/Bookmark

April 9, 2010

How to use Cookies in PHP with examples


A cookie is a message given to a Web browser by a Web server. The browser stores that message in a small text file .Each time the same computer requests a page with a browser, the cookie is sent back to the server too. You can do number of things with cookies. They are used to store information about user, visited pages, poll results and etc. The main purpose of cookies is to identify users and possibly prepare customized Web pages for them.

Generally cookies are used only to store small amounts of data. Websites can read the values from the cookies and use the information as desired. In addition to the information it stores, each cookie has a set of attributes that helps ensure the browser sends the correct cookie when a request to a server is made.

Even though cookies are not harmful some people do not permit cookies due to concerns about their privacy. In this case you have to use Sessions.

How to Create a Cookie?

PHP cookies can be set using the setcookie() function. The syntax is as follows:
setcookie($name, $value, $expire, $path, $domain, $secure) 

  • $name - It is used to define the cookie name. The name of each cookie sent is stored in the superglobal array $_COOKIE.
  • $value - It is used to define the cookie value. It is associated with the cookie name.
  • $expire - It denotes the time after which the cookie should expire in seconds
  • $path - It specifies the exact path on the domain that can use the cookies.
  • $domain - The domain that the cookie is available. If not domain is specified, the default value is the value of the domain in which cookie was created.
  • $secure - It is used to specify whether the cookie will be sent via HTTPS. A value of 1 specifies that the cookie is sent over a secure connection but it doesn't mean that the cookie is secure. It's just a text file like every other cookie. A value of 0 denotes a standard HTTP transmission.
Creating a cookie with setcookie
<?php
setcookie("username", "David", time()+3600);
?>
<html>
<body>
……
…………
………………
</body>
</html>

Cookie username is set with value David which is set to expire after one hour on users computer.

The function time() retrieves the current timestamp. Appending 3600 seconds (one hour) to the current time to make the cookie to expire after one hour.

Note: A cookie must be set before any HTML code as shown above.Cookies work within HTTP, it's important that you send all cookies before any output from your script. This requires that you place calls to this function before any output, including tags as well as any white space. If you don't do this, PHP will give you a warning and your cookies will not be sent.

Creating a permanent cookie

Lets create a cookie which is set to last for 1 year.

<?php
setcookie("username", "David", time()+(60*60*24*365));
?>

How to Retrieve a Cookie ?

Now the cookie is set and we need to retrieve the information. As mentioned above the name of each cookie sent by your server accessed with the superglobal array $_COOKIE. In the example below we retrieve the value of the cookie and print out its value on the screen.

<?php
echo $_COOKIE["username"];
?>

Output =>  David

How to Delete a Cookie?

By default, the cookies are set to be deleted when the browser is closed. We can override that default by setting a time for the cookie's expiration but there may be occasions when you need to delete a cookie before the user closes his browser, and before its expiration time arrives. To do so, you should assure that the expiration date is in the past. The example below demonstrates how to do it (setting expiration time 1 minute ago):
<?php
setcookie("myCookie", "", time()-60);
?>


Read more >> Share/Bookmark

April 8, 2010

Functions and Constructs in PHP


In PHP a function is a predefined set of commands that are carried out when the function is invoked. In addition to being able to write your own functions, PHP has a number of predefine functions for you to use. In function, the interpreter simply starts at the beginning and works its way to the end in a linear fashion. In the real world, this simple approach is rarely practical; for example, you might want to perform a certain operation more than once in different portions of your code. To do so, PHP supports a facility known as a function.

Functions must be declared using the following syntax:
function function_name ([param1], [param 2])
In PHP each function is assigned a name and can receive one or more than one parameters. The parameters exist as variables throughout the execution of the entire function.
Simple function with a parameter:

<?php
function square ($sqr)
{
return $sqr * $sqr;
}
$my_sqr = 50;
echo square ($my_sqr);
?>

The $sqr variable is created whenever the square function is called and initialized with the value passed to it. The return statement is used to return a value from the
function, which later on passes to the calling script. Normally, parameters are passed by some value, this means that, in the previous example, a copy of the $my_sqr variable is placed in the $sqr variable when the function begins, and any changes to the newly generated variable in the function body does not affects former value. But you can overcome this situation by passing a parameter by reference so that any changes performed within the function will also be reflected to the former value. In passing the reference it not only passes the value but also the reference for that value.

<?php
function square (&$my_sqr)
{
$my_sqr += 10;
return $my_sqr * $my_sqr;
}
$sqr = 50;
echo square ($sqr);
?>

You can also assign a default value to any of the parameters of a function when declaring it. This way, if the caller does not provide a value for the parameter, the default one will be used instead:

<?php
function square ($my_sqr = 50)
{
return $my_sqr * $my_sqr;
}
echo square ();
?>

In this case, because no value has been passed for $sqr, the default of 50 will be used by the interpreter. Note that you can’t assign a default value to a parameter passed by reference.

Scope of Functions and Variable
It’s significant to point out that there is no connection between the name of a variable declared inside a function body and any equivalent variables declared outside of it. In PHP, variable scope works differently from most other languages so that what resides in the global scope is not automatically available in a function’s scope. It can be stated more clearly from the following example:

<?php
function square ()
{
$sqr += 10;
return $sqr * $sqr;
}
$sqr = 50;
echo square ();
?>

In this case, the script assumes that the $sqr variable, which is part of the global scope, will be automatically included in the scope of square(). However, this does not take place, so $sqr has a value of Null inside the function, resulting in a return value of 0. If you want to import global variables inside a function’s scope, you can do so by using the global statement:

<?php
function square ()
{
global $sqr;
$sqr += 10;
return $sqr * $sqr;
}
$years = 50;
echo square ();
?>

The $sqr variable is now accessible to the function, where it can be used and modified. Note that by importing the variable inside the function’s scope, any changes made to it will be reflected in the global scope as well—in other words, you’ll be accessing the variable itself, and not an ad hoc copy as you would with a parameter passed by value.

Functions with Variable Parameters
You can also know about the number and types of parameter passed to a particular function. For this you have to just create a function that accepts a variable number of arguments using a number of functions that PHP makes available for you:

func_num_args() returns the number of parameters passed to a function.
func_get_arg($arg_num) returns a particular parameter, given its position in the parameter list.
func_get_args() returns an array containing all the parameters in the parameter list.

As an example, let’s write a function that calculates the arithmetic average of all the parameters passed to it:

<?php
function class_avg()
{
$arg =  func_num_args();
if ($arg == 0)
return 0;
$total = 0;
for ($i = 0; $i < $arg; $i++)
$total += func_get_args($i);
return $total / $arg;
}
echo class_avg (89, 44, 64, 49, 75, 90);
?>

In the preceding example, we started the script by determining the number of arguments and if there is no argument then we are exiting immediately from the function. The reason behind this is that the last instruction would cause a division-by-zero error. Further, we create a for loop that simply cycles through each parameter in sequence, adding its value to the sum. At last, we calculate and return the average value by dividing the sum by the number of parameters. Note how we stored the value of the parameter count in the $arg variable—we did so in order to make the script a bit more efficient because otherwise we would have had to perform a call to func_get_args() for every cycle of the for loop. That would have been rather wasteful because a function call is quite expensive in terms of performance and the number of parameters passed to the function does not change during its execution.

Variable Variables  and Variable  Functions
PHP supports two very useful features known as variable variables and variable functions.
The former allows you use the value of a variable as the name of a variable. Sound confusing? Look at this example:

<?php
$x = 100;
$y = ‘x’;
echo $$y;
?>

When this script is executed and the interpreter encounters the $$y expression, it first determines the value of $y, which is the string a. It then reevaluates the expression with a substituted for $y as $x, thus returning the value of the $x variable. Similarly, you can use a variable’s value as the name of a function:

<?php
function odd_number ($x)
{
echo “$x is odd”;
}
function even_number ($x)
{
echo “$x is even”;
}
$n = 15;
$a = ($n % 2 ? ‘odd_number’ : ‘even_number’);
$a($n);
?>
At the end of the script, $a will contain either odd_number or even_number. The expression $a($n) will then be evaluated as a call to either odd_number() or even_number(). Variable variables and variable functions can be tremendously valuable and convenient. However, they tend to make your code obscure because the only way to really tell what happens during the script’s execution is to execute it—you can’t determine whether what you have written is correct by simply looking at it. As a result, you should only really use variable variables and functions when their usefulness outweighs the potential problems that they can introduce.

Read more >> Share/Bookmark

April 6, 2010

Iteration and Loops in PHP


A loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Loops are basically types of control construct. Loops can be combined so that they are executed at the same time, thus improving the run-time efficiency. Loops save the time of the computers by setting a single code for recurring tasks. They are good because once they are compiled they run over and over again until they reach their limit. Hence resulting in improved efficiency. PHP also supports the following loops:

The while Structure
A while statement executes a code block until a condition is set:


















This prints the table of 2. The instructions written inside the While Loop continues to execute until the value of $a exceeds 10.

Infinite loops are usually not a good thing, but, because PHP provides the proper mechanism for interrupting the loop at any point, they can also be useful.























In this block of code, the (true) condition is always satisfied and, therefore, the compiler will be more than happy to go on repeating the code block forever. Inside the code block itself, we perform two if-then conditions, and the second one is dependent on the first so that the $b > 50 will only be evaluated after $a > 100, and, if both are true, the break statement will cause the execution point to exit from the loop into the preceding scope. Naturally, we could have written this loop just by using the condition ($a <=100 && $b <= 50) in the while loop, but it would have been less efficient because we’d have to perform the check twice. (Remember, $b doesn’t increment unless $a is greater than 100.) If the second condition were a complex expression, our script’s performance might have suffered.


The do-while Structure
The major problem with the while() loop is that, if the condition never evaluates to True, the statements inside the code block are never executed. In some cases, it might be preferable that the code be executed at least once, and then the condition evaluated to determine whether it will be necessary to execute it again.
This can be achieved in one of two ways: either by copying the code outside of the while loop into a separate code block, which is inefficient and makes your scripts more difficult to maintain, or by using a do-while loop:











In this above block of code, $a will be printed once even after the condition is false ($a is not less that 10) because we are using do-while loop which executes the statements written inside the do while loop at least one time even if the condition is false.


The For Loop
The statements in the for loop repeat continuously for a specific number of times. The while and do-while loops repeat until a certain condition is met. The for loop repeats until a specific count is met. You can use a for loop when the number of repetition is know, or can be supplied by the user.









As you can see, the declaration of a for loop is broken in to three parts:
The first expression is known as start Expression. It is evaluated before the loop begins. This start Expression is evaluated only once at the beginning of the loop.
The second represents the condition that must be satisfied for the loop to continue. Finally, the third contains a set of instructions that are executed once at the end of every iteration of the loop before the condition is tested.

Naturally, you can also create a for loop that is infinite in a number of ways, in fact. You could omit the second expression from the declaration, which would cause the interpreter to always evaluate the condition to true. You could omit the third expression and never perform any actions in the code block associated with the loop that will cause the condition in the second expression to be evaluated as true. You can even omit all three expressions using the form for(;;) and end up with the equivalent of while(true).

You can also use while loop inside the For Loop. This can be illustrated more clearly from the following example:






















By executing the above block of code it will print the table from 1 to 10.
 


Read more >> Share/Bookmark

April 5, 2010

Types Of Operators in PHP


There are different types of operators in PHP. Variables, constants, and data types will not be very beneficial to you until you can’t merge and manipulate them in a numerous ways. In PHP, it can be done easily by using operators. PHP recognizes several classes of operators, depending on what purpose they are used for. We can list the operators as follows:

The Assignment Operator
The assignment operator '=' is used to assign a value to a variable:
$x = 65;
$y = “Joseph is a good boy”;
It’s vital to understand that, by default, variables are assigned by value. This means that by doing following:
$x = $y
It will assigns the value of $y to $x. But, if you change $y after assigning, $x will remain the same. Sometimes you don't want to do this and want that when you change the value of $y, it is also been reflected in $x. You can do it easily by assigning to $x a reference to $y:
$x = &$y
Any change to $y will now also be reflected in $x.


Arithmetic Operators
The next operator in this category is Arithmetic operators. These operators are used to do arithmetic calculations like addition, subtraction etc. Arithmetic operators are always been used in binary operations (means that they always include two operators):
  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Modulus (%)
In PHP modulus operation works a bit different from the typical mathematical operation as it returns a signed value rather than an absolute one. PHP also inherits 4 special incrementing/decrementing operators from the C language.

The prefix incrementing operator ++ increases the value of the variable that succeeds it, and then returns its new value. For example, ++$x will firstly increase the value of $x by 1 and then return it.

The postfix incrementing operator ++ returns the value of the variable that pre-cedes it, and then increments its value. For example, $x++ will instantly returns the value of $x and after that it increases the value of $x by 1 for the next operation.

The prefix decrementing operator --decrements the value of the variable that succeeds it, and then returns its new value. For example, --$x will first decreases the value of $x and then returns it.

The postfix decrementing operator -- returns the value of the variable that precedes it, and then decrements its value. For example, $x-- will instantly returns the value of $x and after that it decreases the value of $x by 1 for the next operation.

There is always a great confusion in between these operators, but if you follow a simple rule then it wil be very easy for you. The rule is that if  the variable is placed after the operator (Prefix version) then you must increase or decrease the value first.
But if the variable is placed before the operator (Postfix version) then you must returns the value first and after that increase or decrease the value of the variable.


Bitwise Operators
The next operator in this category is Bitwise operator. It manipulates the value of variables at the bit level:

The bitwise AND (&) operation causes the value of a bit to be set if it is set in both the left and right operands.
For example, 1 & 1 = 1, whereas 1 & 2 = 0

The bitwise OR (|) operation causes the value of a bit to be set if it is set in either the left or right operands.
For example, 1 | 1 = 1 and 1 | 2 = 3

The bitwise XOR (^) operation causes the value of a bit to be set if it is set in either the left or right operands, but not in both.
For example, 1 ^ 1 = 0, 1 ^ 0 = 1

The bitwise NOT (~) operation causes the bits in its operand to be reversed—that is, set if they are not and unset otherwise. The bitwise left-shift (<<) and right-shift (>>) operators actually shift the bits of the left operands left or right by the number of positions specified by the right operand.


Comparison Operators
The next operator in this category is Comparison operator. Comparison operators are used to establish the relationship between two operands. The result of a comparison is always a Boolean value:

The = = operator determines if two values are equal. For example:
$x = = $y where both $x and $y are equal to 10

The != operator determines if two values are different. For example:
$x != $y where $x = 15 and $y=18

The < operator determines whether the left operand’s value is less than the right operand’s. For example:
$x < $y where $x = 25 and $y=67

The > operator determines whether the left operand’s value is greater than the right operand’s. For example:
$x > $y where $x = 85 and $y=62

The <= operator determines whether the left operand’s value is less than or equal to the right operand’s. For example:
$x <= $y where $y = 85 and $x=85 or less than 85

The >= operator determines whether the left operand’s value is greater than the right operand’s. For example:
$x >= $y where $x = 28 and $y=28 or less than 28


Logical Operators
The next operator in this category is Logical operator. Logical operators are generally used in conjunction with comparison operators to create complex decision process. They also return a Boolean result:

The AND operator (indicated by the keyword and or by &&) returns True if both the left and right operands cannot be evaluated to False. For example:
($x < $y) && ($x > $z )
returns true if  $x = 25 , $y=67 and $z=10

The OR operator  (indicated by the keyword or or by ||) returns True if either the left or right operand cannot be evaluated as False. For example:
($x < $y) || ($x > $z )
returns true if  $x = 25 , $y=67 and $z=90

The XOR operator (indicated by the keyword xor) returns True if either the left or right operand can be evaluated as True, but not both. For example:
($x < $y) || ($x > $z )
returns False if  $x = 25 , $y=67 and $z=15

The unary NOT operator (indicated by !) returns False if the operand can be evaluated as True, and True otherwise.


Precedence of PHP Operators

Operator precedence determines the grouping of terms in an expression. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator:

For example x = 8 + 6 * 9; Here x is assigned 62, not 126 because operator * has higher precedence than + so it first get multiplied with 6*9 and then adds into 8.

You can easily understand the precedence of operators with the following table:

Category

Operator

Associativity

Unary

     ! ++ --

Right to left

Multiplicative

     * / %

Left to right

Additive

       + -

Left to right

Relational

  < <= > >=

Left to right

Equality

      = = !=

Left to right

Logical AND
&&
Left to right

Logical OR

        ||

Left to right

Conditional

        ?:

Right to left

Assignment

= += -= *= /= %=

Right to left


Read more >> Share/Bookmark

April 4, 2010

Learn how to set up page caching in Zend Server 5

I found a very useful video describing page caching in Zend Server and I want to share it with all of you. In the following video,you can learn how to set up a page caching rule in Zend Server 5 in order to optimize performance in a demo PHP application. This is very simple instead of writing the application with caching in mind. I am sure that this video will surely help you and increase your knowledge.

Read more >> Share/Bookmark

April 3, 2010

Top 15 Certification Tips To Pass ZEND-PHP 200-500 Exam


The Zend PHP5 ZCE certification is designed to test the level of knowledge and web programming of a candidate using PHP language. Before taking the Zend 200-500 exam, you should practice the following:

  • You should thoroughly understand PHP syntax, operators, variables, constants, functions, and arrays in order to achieve good marks.
  • You should practice and understand OOPS modifiers/inheritance, interfaces, and exceptions.
  • You should know how to implement static methods and properties, and autoload.
  • Practice on configuring and managing session security.
  • You should be able to perform cross-site scripting and cross-site request forgeries.
  • You should also learn how to mitigate SQL injection, remote code injection, and email injection.
  • You should thoroughly learn and understand XML basics, simple XML, XML extension, and Xpath.
  • You should also practice and understand Web services basics.
  • You should know how to implement SOAP and REST.
  • You should be able to perform string searching, replacing, and formatting.
  • You should analyze SQL queries and prepared statements.
  • You must be able to perform GET and POST data.
  • You should know how to implement cookies and HTTP headers.
  • You should practice to perform files reading and writing.
  • You must be able to learn and understand file system functions and streams.


Read more >> Share/Bookmark

March 29, 2010

Learn About ZEND PHP 5Certification and Its Benefits


The Zend PHP 200-500 exam is designed to test an candidate's knowledge of PHP programming, PHP security, XML and Web services, streaming and network programming, etc. Mainly, this test measures the examinees experience in PHP programming. The main goal of this exam is to allow PHP professionals to attain the "Zend Certified Engineer" designation.

Key Objectives of the exam
This certification exam mainly tests your ability in the following areas:

PHP Basics - This objective mainly test your ability in understanding the basic fundamentals of PHP including Syntax, Operators, Variables, Constants etc. In my opinion this is a really good area to score.

Functions and Arrays- This objective validates your proficiency in using Function syntax, and Arguments. It also tests your knowledge in dealing with different type of arrays such as enumerated arrays, multi-dimensional arrays etc. You will have to practice a lot in this area for scoring good marks.

Object Oriented Programming - This objective authenticates your ability and knowledge in underatanding OOP concepts, Instantiation, Modifiers/Inheritance, Interfaces, Exceptions etc.

Security - This objective mainly test your ability in configuration, Session Security, Cross-Site Scripting, Filter Input, and Escape Output etc.

XML and Web Services - This objective mainly deals your skills in understanding with XML Basics, SimpleXML, XML Extension, Xpath. So, you have to practice these type of question to excel in this section.

Strings and Patterns - This objective validates your proficiency in using Searching, Replacing, Formatting strings.

Databases and SQL - This objective deals with database concepts. It tests your ability in using SQL, Joins, Analyzing SQL Queries, Prepared Statements etc.

Web Features - You have to practice a lot about using Sessions, Forms, GET and POST data, Cookies, HTTP Headers to excel and score good marks in this objective.

Streams and Network Programming - This objective includes dealing with file reading and writing, file systems functions and streams.


Number Of Questions
You will be required to attempt 70 questions in the exam.To pass you need a score of 70% . You have to answer these question in 90 minutes.

Why should I earn Zend PHP5 Certification ?
There are numerous advantages of becoming a Zend PHP ZCE (Zend Certified Engineer). I can cover some key points here :
  •  Zend products and PHP programming are most broadly and openly used in the current era and the Zend PHP5 ZCE certification approves your expertise on the Zend products and PHP language.
  • Candidates who are already earned  the Zend Certified Engineer (ZCE) certification are considered as top favorites by the employers and also the No.1 choice for the job and they also get preference in promotions.
  • The PHP5 ZCE certification is helpful for professionals who have an entry-level certification in related PHP technologies and want to upgrade their credentials and get recognition from the industry.
  • A Zend PHP5 Certified professional can find a appropriate job easily and get paid more. And most importantly, on average, a ZCE certified person gets more salary than one having the same job profile.

Any Pre-Requisites for the Zend 200-500 exam?
The candidates who wish to take this ZEND PHP5 exam, they have to take only one test, i.e., Zend 200-50 exam to achieve the ZEND PHP5 certification. Although there are no prerequisites for this certification, it would be helpful if they have hands on experience using the Zend PHP5.

How Much Is The Exam Fees?
The Fee for taking ZEND PHP5 200-500 exam is US$125.

Where To Take The Exam?
The candidates may get register themselves at Pearson VUE testing center to take the exam. After you purchase your exam voucher, you can contact an authorized Pearson VUE center to schedule your exam date, time, and location. You can book the exam within one year from the date of purchase of the voucher. The exam date may depend on your choice (and availability of slot) in your selected test center.






Read more >> Share/Bookmark

March 28, 2010

Introduction To PHP - World's Best Scripting Language

PHP which is also known as Hypertext Preprocessor is a broadly used, open source general-purpose scripting language that was originally designed for web development to produce dynamic web pages. For this reason, PHP code is implanted into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document. PHP code is processed by an interpreter application in command-line mode performing desired operating system operations and producing program output on its standard output channel. The PHP code is enclosed in special start and end processing instructions that allows you to switch into and out of PHP mode. PHP is available as a processor for many of the current web servers and as separate interpreter on most operating systems.

PHP originally stood for personal home page. It was introduce way back in 1994 as a set of Common Gateway Interface (CGI) binaries written in the C programming language.

Simple PHP beginner example












PHP is a general-purpose scripting language that is especially suited to server-side web development where PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content. It can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most web servers, many operating systems and platforms, and can be used with many relational database management systems. It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.

PHP primarily acts as a filter,taking input from a file or stream containing text and/or PHP instructions and outputs another stream of data; most commonly the output will be HTML. Since PHP 4, the PHP parser compiles input to produce byte code for processing by the Zend Engine, giving improved performance over its interpreter predecessor.

PHP was originally designed to create dynamic web pages, but now PHP focuses mainly on server-side scripting, and it is similar to other server-side scripting languages that provide dynamic content from a web server to a client, such as Microsoft's Active Server Pages, Sun Microsystems' JavaServer Pages, and mod_perl. PHP has also attracted the development of many frameworks that provide building blocks and a design structure to promote rapid application development (RAD). Some of these include CakePHP, Symfony, CodeIgniter, and Zend Framework, offering features similar to other web application frameworks.

The LAMP architecture has become popular in the web industry as a way of deploying web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL, although the P may also refer to Python or Perl or some combination of the three.

A new major version has been under development alongside PHP 5 for several years. This version was originally planned to be released as PHP 6 as a result of its significant changes, which included plans for full Unicode support. The new version is set to remove many old features such as the removal of register globals, magic quotes, and safe mode.The reason for the removals was that register_globals had given way to security holes, and magic quotes had an unpredictable nature, and was best avoided. Instead, to escape characters, magic quotes may be substituted with the addslashes() function, or more appropriately an escape mechanism specific to the database vendor itself like mysql_real_escape_string() for MySQL.
Read more >> Share/Bookmark

March 27, 2010

Oops ! I have forgotten my ColdFusion Admin Password, What to do now ?

There are many worst things that can happen in your life. Here is one such example of that, you have to make an urgent project in Adobe ColdFusion and by mistake you have forgotten your password, and you are thinking what to do now. Don't frustrate I will tell you about a simple trick through which you can overcome this situation. Please follow the following easy steps :

1.  The first step is to create a backup of CF_HOME\lib\neo-security.xml file                 
In case if you have installed the multi server edition, the path should be:
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\lib\neo-security.xml

2.   Now open the neo-security.xml file in a notepad and swith the 'true' to 'false' for the admin.security.enabled variable tag. Here is a simple example displaying you how to do this
Search the "admin.security.enabled" in the file and change the code as follows to accomplish the task :
 



3.  The final step is to restart the Adobe ColdFusion application server.

You should now be able to sidestep the login to the Adobe ColdFusion administrator and complete your project. You can further reset the password by selecting Security > Administrator.



.
Read more >> Share/Bookmark