Some Important JavaScript Functions

pop()

This array function is to remove the last element of an array, similarly push() can be used to insert an element.

Example:

var countries = Array(”India”,”America”,”Japan”,”China”);
countries.pop();

window.reload()

This function is used to reload the current browser window.

random()

This function is used to generate a random number. This function will return a random number (fractional) between 0 and 1. This will be coming under Math object. So, we need to call this function as:

Match.random();

MySQL Storage Engines

MySQL has the following storage engines or table types:

  • MyISAM
  • InnoDB
  • HEAP
  • MERGE
  • CSV
  • BLACKHOL

Out of these all mysql storage engines, two engines are most important & these are used by developers frequently as well.

The first one is InnoDB mysql engine; it supports transaction and table locking. And another one is ‘MyISAM’, it supports full text search support using this we can achieve the natural language search for our web site.

wp_468_60

JavaScript Interview Questions and Answers

Here are few JavaScript interview questions and answers:

How do you delete the last element of an array in JavaScript?

array_object_variable.pop();

The pop() method in JavaScript will delete the last element of the array. Whereas the push() method will add a new element at the start of the array.

How do you get the random number between 0 and 50?

my_js_random_number = Math.floor(Math.random() * 51);

In the similar manner you can generate random number from 0 to N, you need to  pass N+1 instead of 51 in this function.

How do you redirect a page using JavaScript?

To redirect to you new page or URL in JavaScript, we can use the location object.

location = ‘newpage.html’

How do you refresh the current page using JavaScript?

To refresh the current page using a javascript function, we can use the below method:

location.reload();

Features in PHP 5.3

The much awaiting php version PHP 5.3 has been released.  The important features of PHP 5.3 version are:

  • ‘goto’ lable for jumping
  • Namespaces supports for PHP Classes.
  • Closures or Anonymous function same like javascript/jQuery anonymous functions.
  • garbage collection support
  • And much more….

You can see the php 5. 3 release version here.

Case Sensitive Search in MySQL

By default mysql searches are case insensitive, that is from the following table:

cms description rating
Joomla Joomla is an open source cms with nice design 3
Drupal Drupal is an open source CMS framework based on MVC architecture 4

This query:

SELECT * FROM `table` WHERE `cms` LIKE '%JOOMLA%'

will fetch the first row of the records. If we want to case sensitive select, we can modify the query as below:

SELECT * FROM `table` WHERE `cms` BINARY LIKE '%JOOMLA%'

The binary operator will help us to achieve this.