Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts

Wednesday, September 2, 2009

HTML mailto attribute

The mailto is a quick way to add the facility of receiving feedback from visitor on your web site. With the HTML mailto, you create a link which when clicked by the visitor launches (if it's not already running) their email program with a new email message window. The visitor could then formulate the email message and send it off to you.

Note: HTML Mailto assumes that the visitor has configured an email client (Outlook Express, Netscape Messenger, Thunderbird or any other) to send emails.

In its simplest form, the HTML mailto requires an email address. However, mailto can be made slightly more professional if we use it properly.


The Basic form of HTML mailto

mailto looks like:


Send me an
email




And this is displayed as



A more complex HTML mailto


We will now learn how to create a more complex HTML mailto by adding an email subject and the email body so that it looks a little more professional. And this will definitely save your visitors some typing too!



Send me an email






Careful inspection of the above code will highlight two points. Firstly, the email address is separated from the other information by a ? sign (question mark) and secondly, body and subject properties are themselves separated using an &.

[Those of you familiar with server-side scripting will find a similarity between this mailto tag and the GET method.]

Remember, the prefilled email Subject and email body values can be changed by the visitor! But this fancy mailto looks better than plain one, doesn't it?

In addition to the body and subject, we can also provide HTML mailto with CC (Carbon Copy) and BCC (Blind Carbon Copy). This, as you would have guessed, requires us to append these values to the HTML mailto attribute just like we had done for body and subject. [Refer code and image below]




Send me an email





Wednesday, June 10, 2009

Create .VBS file To Create Restore Point

Step-1 Open Notepad
Step-2 Copy below code to Noteoad

set SRP = getobject("winmgmts:\\.\root\default:Systemrestore")
CSRP = SRP.createrestorepoint ("Restore Point Created By-Chintan Patel", 0, 100)

Step3 Save as RestorePoint.vbs
Step-4 Double click on RestorePoint.vbs to Take Restore Point


Note:
If you want to Take Restore Point when system start,
then drag that file in to STARTUP

How to Start the System Restore Tool from a Command Prompt



To start the System Restore tool when you cannot start your Windows Me-based computer normally or in Safe mode, you can temporarily change the Windows shell from Explorer.exe to Progman.exe:
  1. Start your computer by using the Windows Me Startup disk.
  2. At the Startup menu, choose Minimum Boot.
  3. At the command prompt, type edit c:\windows\system.ini, and then press ENTER.
  4. Edit the shell= line so that it looks like this:
    shell=progman.exe
  5. Press ALT+F, and then press S to save the changes to the System.ini file.
  6. Press ALT+F, and then press X.
  7. Remove your Windows Me Startup disk, and then restart your computer. When your computer restarts, Program Manager should start. If Program Manager does not start, repeat steps 1 through 7, being careful to follow these steps exactly, and then continue to the next step.
  8. On the File menu, click Run, type msconfig in the Command Line box, and then press ENTER.
  9. Click Launch System Restore to begin restoring your computer to a previous, functional state.


Notes

  • After you configure your computer to start Program Manager (Progman.exe), you can also start the System Restore tool by typing c:\windows\system\restore\rstrui.exe at a command prompt, and then pressing ENTER.
  • If you still cannot use System Restore, repeat steps 1 through 6. In step 4, change the shell= line so that it reads:
    shell=explorer.exe
    This sets the Windows shell back to Explorer.exe so that you can continue troubleshooting.

Wednesday, May 27, 2009

Who set my CLASSPATH?

I never set CLASSPATH environment variable. Instead I always use the explicit -classpath or -cp options when running java, javac, javap, etc. The other day I was surprised to see a CLASSPATH environment variable is set:
C:\tmp> set CLASSPATH
CLASSPATH=.;C:\Program Files\Java\jre1.5.0_09\lib\ext\QTJava.zip
C:\tmp> dir "C:\Program Files\Java\jre1.5.0_09\lib\ext\QTJava.zip"
06/12/2006 09:57 AM 1,180,476 QTJava.zip
It seems when I installed apple's quicktime plugin, it automatically set this CLASSPATH in my environment. I don't like this. I always assume a clean environment when running any java applications. So I removed it:
C:\tmp> set CLASSPATH=
C:\tmp> set CLASSPATH
Environment variable CLASSPATH not defined
I can tolerate an installer modifying my PATH, but not CLASSPATH.

Tuesday, May 26, 2009

How To Embeded Flash in Java Desktop App

Most of examples about playing Flash animation on desktop application I found on the internet to are done by VB. But today I found java version. Flash SWT Plugin, it work very well on my latest project :).

To use Flash SWT Plugin, download com.docuverse.swt.flash-0.4.zip and extract it somewhere on local disk. Now our eclipse flash project need to add atleast two external jars e.g. flash.jar[from where we just extract the zip] and swt.jar and now we are ready to code.

THE SOURCE
To play swf file, all we need is FlashPlayer object and activate it that all. it'll look like this.




import com.docuverse.swt.flash.FlashPlayer;

public class SWTPlayer {
....
private void run() {
// TODO Auto-generated method stub
Display display = new Display();
Shell shell = new Shell(display);
FlashPlayer player = new FlashPlayer(shell);
player.loadMovie(0, "yourflashfile.swf");
player.setSize(550, 400);
player.activate();
shell.setSize(550, 400);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}

How To: Test Your Antivirus

How To: Test Your Antivirus


Have you ever wondered if your anti virus is working properly? I haven’t had a virus alarm for a while now so I started doubting if my antivirus
was working properly or was just hogging my system memory and wasting my time download updates and definitions for nothing.So I decided to find a way to test it, but how could I test my antivirus without risking damaging my system? Why creating my own little virus of course.I’ll show you how to make a virus using notepad that will test the ability and efficiency of your current antivirus without causing any damage to your computer even if you don’t have an anti virus nothing will happen.Lets get to it:


1) Open a new notepad document

2) Type the code below into the notepad file.

X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


3) Save the notepad file as FakeVirus.com or whatever you want, To comfortably find the file, I suggest placing it in the Desktop.To save a file in .com format all you need to do is change the “Save as type:” to All Files and then just enter FakeVirus.com in the “File name:” section and click Save.

4) Run the FakeVirus.com file to test your computers efficiency. If your anti virus software
doesn’t give you a warning or alert, I suggest changing your AntiVirus immediately as your current one doesn’t work properly.Check out this article for a few good free antivirus softwares.

5) After your done with the file just delete it and empty the trash, remember this fake virus won’t affect your computer in any way.

Enjoy.

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 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

How To Format USB Drive with NTFS File System

The advantage of NTFS file system is more security options and fast. Normally USB drive capacity is very small enough that NTFS is not recommended. But, nowadays USB drives are coming with larger capacity also. So we can format USB drive with NTFS to have more security options.

NTFS enabled USB Drives are write-able only on one PC and becomes read only on all other PCs. Hence, we can read and write on our own PC and transfer files to elsewhere without any fear of virus.

In XP, only FAT and FAT32 file systems are available in format options, use the below steps to format in NTFS File System.

1). Insert USB drive in your PC
2). Goto Device Manager (Start>Run>devmgmt.msc)
3). Select Disk Drives and expand
4). Right Click on USB drive and select Properties
5). Goto policies tab and select Optimize for performance and press OK
6). Open My Computer, Click on USB Drive and select Format Opton

Now you can have NTFS option there.

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