Skip to main content

Posts

Showing posts from February, 2012

BSNL tablet gets over one lakh pre order requests

Public sector telecom operator, BSNL, which recently launched extremely low cost tablets along with two mid range tablets, has got a tremendous response from Indian consumers. The three tablets, bundled with its connection, are in the price range of Rs 3,499 - Rs 12,500. They are manufactured by Noida based Pantel Technologies. Virendra Singh, managing director of Pantel Technologies, said to The Mobile Indian, "We have received more than one lakh pre booking orders over phone and online for the three tablets which we have launched in association with BSNL." He further added, "Apart from the consumers' interest, we have also got an order for two lakh tablets from Sahara India." The entry level BSNL tablet, Penta IS701R, is a WiFi only device with Android 2.3 operating system, 1 GHz processor and 256 MB RAM. The tablet also has an HDMI port through which it can be connected to a TV. Its 7 inch resistive touchscreen has 800 x 600 pixel resolution and 16:9 asp...

Find extension of file in Php

In our scripting sometimes we need to upload such documents , at that time there should be a validation for proper file. For example in your system suppose there is a field for image upload , that is obvious in that field only image formats are allowed (jpg,jpeg,png,gif etc.). At that time you have to give a validation on that field. In Php to find the extension and validation here is your code :  <?php                     $image = $_FILES["file"]["name"];    // to fetch the file name             $n1=strripos($image,".");                     // to find the last position of "."             $v1 =substr($image,$n1);                  ...

Find extension of file in Javascript

In our scripting sometimes we need to upload such documents , at that time there should be a validation for proper file. For example in your system suppose there is a field for image upload , that is obvious in that field only image formats are allowed (jpg,jpeg,png,gif etc.). At that time you have to give a validation on that field. In javascript to find the extension and validation here is your code :  <script type="text/javascript">       var str = document.form1.file.value.toLowerCase();                                  // to convert the value in lower case       var split = str.split(".");     // split the value by "."       var s =split.length;          // find the length       var ext = (split[s-1]);   ...

Use of indexOf and charAt in javascript

indexOf(): The indexOf() method returns the position of the first occurrence of a specified value in a string. This method returns -1 if the value to search for never occurs. example :  <script type="text/javascript"> var str="Hello world!"; document.write(str.indexOf("d") + "<br />"); document.write(str.indexOf("WORLD") + "<br />"); document.write(str.indexOf("world")); </script> Output : 10 -1 6 charAt() The charAt() method returns the character at the specified index in a string. The index of the first character is 0, and the index of the last character in a string called "txt", is txt.length-1 <script type="text/javascript"> var str = "Hello world!"; document.write("First character: " + str.charAt(0) + "<br />"); document.write("Last character: " + str.charAt(str.l...

Find the difference between array

Sometimes we need to find the difference between arrays In php there is a inbuilt function to find the difference between array. For example : <?php $a1=array(0=>"Apple",1=>"Honda",2=>"Scoda"); $a2=array(3=>"Scoda",4=>"Honda",5=>"Ford"); print_r(array_diff($a1,$a2)); ?>  The output of the code above will be:  Array ( [0] => Apple ) 

Difference between == and === in php

Two of the many comparison operators used by PHP are '==' (i.e. equal) and '===' (i.e. identical). The difference between the two is that '==' should be used to check if the values of the two operands are equal or not. On the other hand, '===' checks the values as well as the type of operands. Let me explain more using some examples: '==' (Equal): if("22" == 22) echo "YES"; else echo "NO";      The code above will print "YES". The reason is that the values of the operands are equal. Whereas when we run the example code below: '===' (Identical): if("22" === 22) echo "YES"; else echo "NO"; The result we get is "NO". The reason is that although values of both operands are same their types are different, "22" (with quotes) is a string while 22 (w/o quotes) is an integer. But if we change the code above to t...

Change port in Wamp server

Difference Between $ and $$ When you face the problem that Wampserver is not working or localhost is not working. There mainly because of three reason Namely : i) When in your system Skype (some application which use same port) is running ii) In your system IIS is running iii) For any other reason confliction We will sort out it one by one.   1) When in your system skype (some application which use same port) is running , Aassume in your  system  skype is running at that time first start your wamp after that start your skype   then both will work.       It is because skype use either port 80 or 443 .       If you dont want to do each and every time just follow the steps for permanent solution     i) Open skype ->> select tools ->> option     ii) Now click on advanced and in advance connection . You can find a checkbox Use po...