Wednesday, May 20, 2009

How To Change Network IP From Batch File






1. Open notepad.
2. Now copy the code that is given below
netsh interface ip set address name="Local Area Connection" source=static addr=192.168.1.100 mask=255.255.255.0netsh interface ip set address name="Local Area Connection" gateway=192.168.1.1 gwmetric=0netsh interface ip set dns name="Local Area Connection" source=static addr=208.67.222.222netsh interface ip add dns name = "Local Area Connection" addr =208.67.220.220

The relevant IP’s are illustrated in the screenshot below, the IP’s that are illustrated are only examples:

3. Now that you have copied the code, paste this in the Notepad. Enter the IP’s as per your requirements and save the file with the extension *.bat

[eminimall]

4. Your batch file is now ready for execution, now double click the batch file that you just created and you will find your network settings configured in a few seconds.

5. Create another batch file using the similar procedure, in this batch file you enter the IP’s that are relevant to your other location.

6. Now you should be having two batch files one for your office network and the other for your home network.

I guess by using this method your life would ease a bit. :) If you have better method then do let me know.

Tuesday, May 19, 2009

Free Download Sites

Downlad Free Softwares From
http://www.download3000.com/





Downlad Free Softwares From
http://www.soft32.com/






Downlad Free Softwares From
http://www.softpedia.com/




Downlad Free Softwares From
http://www.download3k.com/




Downlad Free Softwares From
http://download.cnet.com/windows/



Downlad Free Softwares From
http://www.freedownloadscenter.com/







Downlad Free Softwares From
http://www.topsofts.com/








Downlad Free Softwares From
http://www.freewarefiles.com/



Downlad Free Softwares From
http://100-downloads.com/

Sunday, May 17, 2009

How To Set The Line Number In TextArea

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Untitled Page</title>

<style type="text/css">

#container

{

width: 20px;

float: left;

color: Gray;

font-family: Courier New;

font-size: 14px;

overflow: hidden;

height: 85px;

position: relative;

top: 5px;

}

#divlines

{

position: absolute;

}

#text1

{

overflow-x: scroll;

height: 99px;

font-family: Courier New;

font-size: 14px;

}

</style>

</head>

<body>

<div id="container">

<div id="divlines">

</div>

</div>

<textarea id="text1" cols="50" wrap="off">first

second

third

fourth

fifth

sixth

seventh

eighth

ninth</textarea>

<script type="text/javascript">

var lines = document.getElementById("divlines");

var txtArea = document.getElementById("text1");

window.onload = function() {

refreshlines();

txtArea.onscroll = function () {

lines.style.top = -(txtArea.scrollTop) + "px";

return true;

}

txtArea.onkeyup = function () {

refreshlines();

return true;

}

}



function refreshlines() {

var nLines = txtArea.value.split("\n").length;

lines.innerHTML = ""

for (i=1; i<=nLines; i++) {

lines.innerHTML = lines.innerHTML + i + "." + "<br />";

}

lines.style.top = -(txtArea.scrollTop) + "px";

}

</script>

</body>

</html>

How To Set The Foucs On Last Row in TextArea

<script type="text/javascript">
window.onload=function WindowLoad(event)
{
var objControl=document.forms["FrmTestScroll"].elements["textarea1"];
objControl.scrollTop = objControl.scrollHeight;
}
</script>
<form id="FrmTestScroll">
<textarea rows="3" cols="10" name="textarea1">lots of text goes here. it would be on more than one line.</textarea>
</form>


Sunday, May 10, 2009

Insertion Sort Implementation in Java

Insertion sort is a simple sorting algorithm, a comparison sort in which the sorted array (or list) is built one entry at a time. It is much less efficient on large lists than the more advanced algorithms such as quicksort, heapsort, or merge sort, but it has various advantages:
Simple to implement
Efficient on (quite) small data sets
Efficient on data sets which are already substantially sorted
More efficient in practice than most other simple O(n2) algorithms such as selection sort or bubble sort: the average time is n2/4 and it is linear in the best case
Stable (does not change the relative order of elements with equal keys)
In-place (only requires a constant amount O(1) of extra memory space)
It is an online algorithm, in that it can sort a list as it receives it.
In abstract terms, each iteration of an insertion sort removes an element from the input data, inserting it at the correct position in the already sorted list, until no elements are left in the input. The choice of which element to remove from the input is arbitrary and can be made using almost any choice algorithm.




/*** Simple insertion sort.* @param a an array of Comparable items.*/
public static void insertionSort( Comparable [ ] a )
{for( int p = 1; p < a.length; p++ )
{
Comparable tmp = a[ p ];int j = p;
for( ; j > 0 && tmp.compareTo( a[ j - 1 ] ) < 0; j-- )
a[ j ] = a[ j - 1 ];
a[ j ] = tmp;
}
}

BinarySearch in Java

public class BinarySearch
{
public static final int NOT_FOUND = -1;
/**
* Performs the standard binary search
* using two comparisons per level.
* @return index where item is found, or NOT_FOUND.
*/
public static int binarySearch( Comparable [ ] a, Comparable x )
{
int low = 0;
int high = a.length - 1;
int mid;
while( low <= high )
{
mid = ( low + high ) / 2;
if( a[ mid ].compareTo( x ) < 0 )
low = mid + 1;
else if( a[ mid ].compareTo( x ) > 0 )
high = mid - 1;
else
return mid;
}
return NOT_FOUND; // NOT_FOUND = -1
}
// Test program
public static void main( String [ ] args )
{
int SIZE = 8;
Comparable [ ] a = new Integer [ SIZE ];
for( int i = 0; i < SIZE; i++ )
a[ i ] = new Integer( i * 2 );
for( int i = 0; i < SIZE * 2; i++ )
System.out.println( "Found " + i + " at " +
binarySearch( a, new Integer( i ) ) );
}
}

Sunday, May 3, 2009

How To Increase Heap Size of Tomcat

1. Opne "catalina.bat"
2. find word "set JAVA_OPTS="
3. Replace find string with below string

set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -Xms1024m -Xmx1024m -XX:MaxPermSize=128m

Monday, March 30, 2009

How To Disable Autorun

If your pen drive is affected by any virus/worm/malware then it is suggested to disable the autorun function in your computer.

Here are the steps to disable the autorun.

1.Go to start ->Run

Type gpedit.msc

press Enter

2.In that go to Administrative Templates->System->Turn off autoplay

3.Now set it to Enabled if you want to turn off the autorun feature.

The default value will not configured

4.There is one more option in it

We have to select between All drives/ CD-ROM drives

Select CD-ROM drive if you want to disable autorun only for CDS or select all drives if you want to turn off autorun for all drives including your pen drives or flash drives

5 ways to speed up your PC

By following a few simple guidelines, you can maintain your computer and keep it running smoothly. This article discusses how to use the tools available in Windows XP Service Pack 2 (SP2) and Windows Vista to more efficiently maintain your computer and safeguard your privacy when you're online.

Free up disk space
By freeing disk space, you can improve the performance of your computer. The Disk Cleanup tool helps you free up space on your hard disk. The utility identifies files that you can safely delete, and then enables you to choose whether you want to delete some or all of the identified files.
Use Disk Cleanup to:

• Remove temporary Internet files.
• Remove downloaded program files (such as Microsoft ActiveX controls and Java applets).
• Empty the Recycle Bin.
• Remove Windows temporary files.
• Remove optional Windows components that you don't use.
• Remove installed programs that you no longer use.

Tip: Typically, temporary Internet files take the most amount of space because the browser caches each page you visit for faster access later.

To use Disk Cleanup

1. Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Disk Cleanup. If several drives are available, you might be prompted to specify which drive you want to clean.
2. In the Disk Cleanup for dialog box, scroll through the content of the Files to delete list.
3. Clear the check boxes for files that you don't want to delete, and then click OK.
4. When prompted to confirm that you want to delete the specified files, click Yes.

After a few minutes, the process completes and the Disk Cleanup dialog box closes, leaving your computer cleaner and performing better.

Speed up access to data
Disk fragmentation slows the overall performance of your system. When files are fragmented, the computer must search the hard disk when the file is opened to piece it back together. The response time can be significantly longer.

Disk Defragmenter is a Windows utility that consolidates fragmented files and folders on your computer's hard disk so that each occupies a single space on the disk. With your files stored neatly end-to-end, without fragmentation, reading and writing to the disk speeds up.

When to run Disk Defragmenter
In addition to running Disk Defragmenter at regular intervals—monthly is optimal—there are other times you should run it too, such as when:

• You add a large number of files.
• Your free disk space totals 15 percent or less.
• You install new programs or a new version of Windows.

To use Disk Defragmenter:
1.Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Disk Defragmenter.
2.In the Disk Defragmenter dialog box, click the drives that you want to defragment, and then click the Analyze button. After the disk is analyzed, a dialog box appears, letting you know whether you should defragment the analyzed drives.

Tip: You should analyze a volume before defragmenting it to get an estimate of how long the defragmentation process will take.

3.To defragment the selected drive or drives, click the Defragment button. Note: In Windows Vista, there is no graphical user interface to demonstrate the progress—but your hard drive is still being defragmented.
After the defragmentation is complete, Disk Defragmenter displays the results.
4.To display detailed information about the defragmented disk or partition, click View Report.
5.To close the View Report dialog box, click Close.
6.To close the Disk Defragmenter utility, click the Close button on the title bar of the window.

Detect and repair disk errors

In addition to running Disk Cleanup and Disk Defragmenter to optimize the performance of your computer, you can check the integrity of the files stored on your hard disk by running the Error Checking utility.

As you use your hard drive, it can develop bad sectors. Bad sectors slow down hard disk performance and sometimes make data writing (such as file saving) difficult, or even impossible. The Error Checking utility scans the hard drive for bad sectors, and scans for file system errors to see whether certain files or folders are misplaced.

If you use your computer daily, you should run this utility once a week to help prevent data loss.

To run the Error Checking utility:

1.Close all open files.
2.Click Start, and then click My Computer.
3.In the My Computer window, right-click the hard disk you want to search for bad sectors, and then click Properties.
4.In the Properties dialog box, click the Tools tab.
5.Click the Check Now button.
6.In the Check Disk dialog box, select the Scan for and attempt recovery of bad sectors check box, and then click Start.
7.If bad sectors are found, choose to fix them.

Tip: Only select the "Automatically fix file system errors" check box if you think that your disk contains bad sectors.

Protect your computer against spyware

Spyware collects personal information without letting you know and without asking for permission. From the Web sites you visit to usernames and passwords, spyware can put you and your confidential information at risk. In addition to privacy concerns, spyware can hamper your computer's performance.

Learn all about ReadyBoost

If you're using Windows Vista, you can use ReadyBoost to speed up your system. A new concept in adding memory to a system, it allows you to use non-volatile flash memory—like a USB flash drive or a memory card—to improve performance without having to add additional memory.

How To Block USB Devices

To this what can be done is that the USB can be blocked and then stopping the use of USB drives. Here is a simple registry hack to do so, try it with care.

1. Go to Start –> Run, type Regedit.
2. Go to HKEY_LOCAL_MACHINE\System\CurrentControlset\Services\USBStor
3. In the right pane, look for value Start and have value as 0000000(3)
4. Double click on that and change that value to 4.

You might be required to restart the PC, and then you are done with it, USB is now blocked.

In case if you want to get the USB unblocked, just change the value again to 3.
See, its so easy. Isn’t it