2010
06.26

A favicon (short for favorites icon), also known as a website icon, shortcut icon, URL icon, or bookmark icon  is a 16×16, 32×32 or 64×64 pixel square icon associated with a particular website  or webpage. Browsers that provide favicon support typically display a page’s favicon in the browser’s address bar and next to the page’s name in a list of bookmarks. Browsers that support a tabbed document interface typically show a page’s favicon next to the page’s title on the tab.

Associating the Shortcut Icon with Your Web Page

After creating the icon, you must associate it with your Web page. There are two methods for doing this.

  1. The first method is to save the icon with the default file name of favicon.ico to the root directory of your domain—for example, www.tejaspmehta.com/favicon.ico.
  2. The second method for associating a shortcut icon with your Web page is to add a line of HTML code to the page’s head  element. The line of code includes a link  tag that specifies the location and name of the icon file.


<head>
<link rel="SHORTCUT ICON" href="http://www.tejaspmehta.com/myicon.ico"/>
<title>My Title</title>
</head>

You can use either method, or both. However, if you use the second method, whichever icon you point to in the link tag on each page will be displayed instead of the default favicon.ico file at the root of your domain.

2010
06.01

Mozilla Firefox is a free web browser used by almost 25% worldwide, making it the second most used browser worldwide after Microsoft’s Internet Explorer.

To know more about Firefox browser follow : http://en.wikipedia.org/wiki/Mozilla_Firefox

Here are some Keyboard Shortcuts for Mozilla Firefox

CTRL + A Select all text on a webpage
CTRL + B Open the Bookmarks sidebar
CTRL + C Copy the selected text to the Windows clipboard
CTRL + D Bookmark the current webpage
CTRL + F Find text within the current webpage
CTRL + G Find more text within the same webpage
CTRL + H Opens the webpage History sidebar
CTRL + I Open the Bookmarks sidebar
CTRL + J Opens the Download Dialogue Box
CTRL + K Places the cursor in the Web Search box ready to type your search
CTRL + L Places the cursor into the URL box ready to type a website address
CTRL + M Opens your mail program (if you have one) to create a new email message
CTRL + N Opens a new Firefox window
CTRL + O Open a local file
CTRL + P Print the current webpage
CTRL + R Reloads the current webpage
CTRL + S Save the current webpage on your PC
CTRL + T Opens a new Firefox Tab
CTRL + U View the page source of the current webpage
CTRL + V Paste the contents of the Windows clipboard
CTRL + W Closes the current Firefox Tab or Window (if more than one tab is open)
CTRL + Z Undo the last action

F1 Opens Firefox help
F3 Find more text within the same webpage
F5 Reload the current webpage
F6 Toggles the cursor between the address/URL input box and the current webpage
F7 Toggles Caret Browsing on and off. Used to be able to select text on a webpage with the keyboard
F11 Switch to Full Screen mode

2010
05.07

Few days back i faced one problem. I had to make one javascript in which there are two different select box and at time of page load one select box is full with values while another is empty. With help of buttons or images selected values of box 1 will be transferred to box 2.

Initially i tried to find solution on internet but didn’t find appropriate solution, so decided to write my own javascript. And i have added addititional functionality of swapping of elements in select box 2.

First define two select box
Box 1 : named as sender
Box 2 : named as receiver

Define few values in Box 1.

Now make two different buttons which will transfer values from Box1 to Box2 and vice-verse.

After creation of Basic HTML we will now move to javascript code. Define javascript code in

head section of HTML. Here is code.


function addOption(theSel,theText,theValue){
var newOpt=new Option(theText,theValue);
var selLength=theSel.length;
theSel.options[selLength]=newOpt;
}
function deleteOption(theSel,theIndex){
var selLength=theSel.length;
if(selLength>0){
theSel.options[theIndex]=null;
}
}
function selAll() {
elem=document.getElementById('receiver');
varr=new Array();
for (d=0;d=0;i--){
if(theSelFrom.options[i].selected){
selectedText[selectedCount]=theSelFrom.options[i].text;
selectedValues[selectedCount]=theSelFrom.options[i].value;
deleteOption(theSelFrom,i);
selectedCount++;
}
}
for(i=selectedCount-1;i>=0;i--){
addOption(theSelTo,selectedText[i],selectedValues[i]);
}
selAll();
}
function swapOpt(shift) {
elem=document.getElementById('receiver');
ind=elem.selectedIndex;
if(ind!=-1) {
if(ind==0 && shift==-1){return false;}
if(ind==elem.length-1 && shift==1){return false;}
nind=ind+shift;
tval=elem.options[nind].value;
ttxt=elem.options[nind].text;
elem.options[nind].value=elem.options[ind].value;
elem.options[nind].text=elem.options[ind].text;
elem.options[ind].value=tval;
elem.options[ind].text=ttxt;
elem.selectedIndex=nind;
selAll();
}
}
function frmCheck() {
if(document.form1.tmps.value=="") {
alert("Please select input field(s)!");
return false;
}
}

To make this working properly i have provided HTML code also


  <form name="form1" method="post" onsubmit="return frmCheck();">
    <table class="form" cellpadding="3" cellspacing="1">
      <tr>
        <td><select size="10" style="width:80px;" name="sender" id="sender" 

ondblclick="moveOptions('sender','receiver')">
            <option value="1">Name 1</option>
            <option value="2">Name 2</option>
            <option value="3">Name 3</option>
            <option value="4">Name 4</option>
            <option value="5">Name 5</option>
          </select>
        </td>
        <td><input value="&#9658;" type="button" onclick="moveOptions('sender','receiver')" 

/>
          <br />
          <input  value="&#9668;" type="button" onclick="moveOptions('receiver','sender')" 

/>
        </td>
        <td><select size="10" style="width:80px;" id="receiver" name="receiver" 

ondblclick="moveOptions('receiver','sender')">
          </select>
          <input type="hidden" name="tmps" id="tmps" value="" />
        </td>
        <td valign="top"><input value="&#9650;" type="button" onclick="swapOpt(-1)" />
          <br />
          <input value="&#9660;" type="button" onclick="swapOpt(1)" />
        </td>
      </tr>
      <tr>
        <td colspan="4" align="center"><input class="inputBut" type="submit" value="Submit" 

/></td>
      </tr>
    </table>
  </form>

Here is working demo link.

If you like this article than please do comment.

2010
02.23

Here i have listed some tips which help to improve your computer’s performance. These examples use Microsoft Windows XP. Some of the screens may differ from version to version, but overall you’ll find these tips work for all versions of Windows.
Clean up disk errors
When to execute :Run once a week

Procedure :
To run Disk Check:

  1. Click My Computer.
  2. In the My Computer dialog box, right-click on the drive you wish to check for errors, and click Properties.
  3. In the Properties dialog box, click the Tools tab. In the Error-Checking section, press the Check Now… button. A Check Disk dialog box displays, as shown below.
  4. In the Check Disk dialog box, check all the check boxes. Click Start.

optimize1
Note: Check Disk can take more than an hour to check and clean errors on your computer.
Remove temporary files
When to execute :Run once a week

Your computer have stored temporary files when you’re looking at Web pages and even when you’re working on files in programs, such as Microsoft Word. These files will slow your computer’s performance.

Procedure :
To run Disk Cleanup:

  1. Go To Start Menu -> Programs -> Accessories -> System Tools -> Disk Cleanup.
  2. Select your drive and press OK.
  3. Disk Cleanup will calculate how much space you can free up on your hard drive. After its scan, the Disk Cleanup dialog box reports a list of files you can remove from your computer. This scan can take a while depending on how many files you have in your computer.

optimize2After the scan is complete, in the Disk Cleanup dialog box, click View Files to see what Disk Cleanup will throw out once you give it the go ahead. You can check and uncheck boxes to define what you wish to keep or discard. When you’re ready, click OK.


Rearrange your data with Disk Defragmenter
When to execute : Run once a month

  1. Go To Start Menu -> Programs -> Accessories -> System Tools -> Disk Defragmenter.
  2. Select your drive and press Defragment.
  3. After analyzing your computer, the Disk Defragmenter displays a message stating whether you should defragment your drive. Press Defragment to clean up your computer if necessary. The Disk Defragmenter will reorganize files by placing together and organizing them by program and size, as shown in Figure.

optimize3

Install antivirus and antispyware programs

Computer viruses and spyware (hidden software that gathers information about you without your knowledge or consent when you’re using a computer) both reduce system performance. Computer viruses can not only reduce performance, but they can also destroy data. Any computer that accesses the Internet should have antivirus and antispyware programs installed.

2010
01.28

I was searching in google map that how to display marker first. So i find out that google map display marker with help of latitude and longnitude. With help of that i have made one basic application for my customer. Now problem arise when customer asks me to make it working with address stored in database. Initially i thought it will be easy to make it but i was stuck when i found that with help of Address to get latitude and longnitude is not easy. So here is a brief tutorial what i have gone throught and make it working.

First Sign Up for the Google Maps API link

Now goto http://code.google.com/apis/maps/documentation/overlays.html and find Custom Icons in Markers section. Understand this example properly. This is example of creating markers at random place with Text on it.

google_map

Now we will use GClientGeocoder method of google to find address. First we add our addresses in one single dimension array and after that we call one function which get Latitude and Longnitude of those address and place marker in google map.

I have uploaded one file here. You can download it from here. This is working example with 2 different addresses of London. You have to just change your API key in this example.

This is how it looks.

final_map

Rss Feed Tweeter button Facebook button Linkedin button