Monday, August 4, 2008

Improve PC Performance Tips

Follow these 6 simple sure-fire tips to help improve PC performance and you'll be surprised by the results! Each comes with an indication of how often you should do it.

Improve PC Performance Tip #1:

CLEAN UP YOUR WINDOWS REGISTRY (Frequency = Daily)

This is an essential, but often overlooked, task to improve PC performance. In fact most PC users are unaware of the necessity to regularly clean the Registry as Microsoft does not include a cleanup tool in any version of Windows.

Every time a program is installed it makes changes to the Windows Registry - a huge internal database of Windows' settings. Virtually all Windows programs, and Windows itself, store a massive array of information inside the database. These thousands of entries control the behavior and appearance of virtually everything on your system.

Changes to your PC system are not always handled correctly in the Registry, leading to conflicts and the slowing down of your PC. Over time this leads to a bloated, and possibly corrupted, Registry. Reasons for this include:

  • frequently installing or uninstalling programs
  • removing a program which leaves traces behind
  • leftover entries from a hardware uninstall
  • unused drivers on your system
  • Spyware or similar programs that reappear every time you reboot

You can edit the Registry manually using a Windows program called Regedit, but this is really a job best left for hardened PC experts.

Thankfully, programs are available that can clean up your Registry automatically to help improve PC performance, such as "Registry Optimizer '06". This scans your Registry, looks for entries that are redundant or invalid and lists them so that they can be corrected with one mouse click. As an added bonus, to improve PC performance, it runs automatically in the background every time you start your PC.

Improve PC Performance Tip #2:

EMPTY THE RECYCLE BIN (Frequency = Weekly)

Regularly empty Windows' Recycle Bin.

This will release hard drive space and help improve PC performance.

When you choose to delete a file, rather than removing it completely from your computer, Windows first puts it into the Recycle Bin. This gives you a second chance, as it means you can restore flies from the Recycle Bin back to their original place on your computer.

To ensure optimum PC performance, empty your Recycle Bin weekly (or even daily). To do so, right-click the Recycle Bin icon on your desktop, and choose Empty Recycle Bin.

Improve PC Performance Tip #3:

REMOVE PROGRAMS (Frequency = Monthly)

Installing programs is easy - but once you have, it's just as easy to end up leaving them languishing, forgotten, on your hard disk.

Most programs come with their own uninstaller. You'll find this under the program's entry in All Programs, from the Start menu.

If the program doesn't come with its own uninstaller, open Control Panel from the Start menu, and double-click Add/Remove Programs. Your PC will pause briefly while it gathers a list of all the programs you have installed.

Once it has done so, find the program you'd like to get rid of, click it and then select Change/Remove.

Be aware that some programs leave uninstalled traces all over the Windows Registry! Therefore, to improve PC performance after an uninstall, it's essential to clean the Registry.

Improve PC Performance Tip #4:

RUN DISK CLEAN UP (Frequency = Monthly)

Windows' Disk Clean Up is a fantastic built-in utility that automates regular maintenance tasks to improve PC performance, such as deleting Temporary Internet files, Setup log files, etc.

To start Disk Clean Up, double-click My Computer, right click on your 'C:' drive and then select Properties. Now click Disk Cleanup. Your computer will then spend a few moments analysing itself.

When it has completed the audit Windows will give you a list of areas where it has found files to cleanup. To clean an area, put a tick in the box next to it. To leave something intact, such as Temporary files, just remove the tick next to the item and click OK.

Your computer will then begin the removal process to improve PC performance - this can take some time.

Improve PC Performance Tip #5:

DISK DEFRAGMENTATION (Frequency = Quarterly)

When Windows stores programs on your PC hard disk it saves fragments of files in the nearest empty spaces.

This slows down your PC as it has to spend time hunting down the fragments and piecing files together.

There is a simple cure - running the Windows program Disk Defragmenter. This gathers together the fragments of programs and puts them back in the right order.

This makes it far easier for your hard disk to find what it's looking for, enabling programs and files to load more quickly - a sure-fired way for improving PC performance.

To defragment your hard disk click Start, All Programs, Accessories, System Tools and then Disk Defragment. When the program has loaded, click Defragment.

The process can take well over an hour. Because defragmenting your hard disk takes such a long time, you really don't want to go through the process too often.

Defragment your hard disk every 3 months or so - this way you'll get the best results and optimize the performance of your PC.

Improve PC Performance Tip #6:

EMPTY THE PREFETCH CACHE (Frequency = Quarterly)

To improve the time it takes to load programs, Windows guesses which files are likely to be needed next and loads them into a pool or 'cache'.

This process is called prefetching, and it generally works well. Overtime, though, the prefetch cache can become clogged with files you no longer need - and that can slow down Windows' startup.

To clear Prefetch, choose Run from the Start menu, and enter Prefetch into the text box that appears. When you've done that, you'll be confronted by a window filled with icons. Press Alt+A to select them all and press Delete.

The cache will quickly refill with links and files that Windows really needs. As a result, your system will feel more responsive and benefit from a PC performance improvement.

So there you have it, 6 sure-fired PC performance tips to revitalize your PC. Now you know how to improve PC performance - simply follow these steps and repeat them regularly.

Source: http://searchwarp.com/swa13229.htm

 

Sunday, August 3, 2008

"Permission denied" - Data recovery in Windows XP

“Permission denied” - Data recovery in Windows XP

Due to some reason my Windows OS is not working now. So right now my harddisk is a device with data but no working operating system. I plugged in the drive at the friend’s machine. I am able to access all data (picture, text data, etc) in D, E, .. drives, all data in C drive can be accessed except in folder “C:\Documents and Settings\anant” which is the administrator profile (Username). The Error message I get is “Access is denied”.

I am accessing the data in my harddisk by connecting to my friend’s PC and making my harddisk as slave so that my drives are viewed in his My Computer. My PC also had 2 other profiles ( non-administrator profiles) which can accessed.

Please give me input on how I can access my administrator profile.
- Anant

This has occured because that folder was created on an NTFS file system volume by using a some other installation of Windows XP, and then accessing from another Windows XP and the security ID doesn’t match the security ID of the owner of the folder and so you cannot open.

To resolve this issue, you must turn off Simple File Sharing, and then take ownership of the folder. The steps are as follows:-

  1. Turn off Simple File Sharing:
    1. Click Start, and then click My Computer.
    2. On the Tools menu, click Folder Options, and then click the View tab.
    3. Under Advanced Settings, click to clear the Use simple file sharing (Recommended) check box, and then click OK.
  2. Taking Ownership:
    1. Right-click the folder that you want to take ownership of, and then click Properties.
    2. Click the Security tab, and then click OK on the Security message, if one appears.
    3. Click Advanced, and then click the Owner tab.
    4. In the Name list, click your user name, Administrator if you are logged in as Administrator, or click the Administrators group.
    5. If you want to take ownership of the contents of that folder, click to select the Replace owner on subcontainers and objects check box.
    6. Click OK.
    7. You may receive the following error message, where Folder is the name of the folder that you want to take ownership of:

You do not have permission to read the contents of directory Folder. Do you want to replace the directory permissions with permissions granting you Full Control? All permissions will be replaced if you press Yes.

    1. Click Yes.
    2. Click OK, and then reapply the permissions and security settings that you want for the folder and the folder contents.

Disclaimer: I do not guarantee that this will save your files. All I can say is that I’ve done it successfully on dozens of machines.

Source: http://www.jkg.in/37-permission-denied-data-recovery-in-windows-xp/

 

Thursday, July 10, 2008

Regex matching

Few notes when using regular expressions:
.*
match is greedy and will match as many as possible.
For example regex: “<Tag>.*</Tag>” will match full string “<Tag> some text </Tag> <Tag> some other text </Tag>” and not “<Tag> some text </Tag>” as you would expect.
While .*? is reluctant and will match only “<Tag> some text </Tag>”

Another thing to note is .* and .*? matches only string char and exclude line characters. For example if input is:
“<Tag> some \n text </Tag> <Tag> some other text </Tag>”
Then above expression will not match, to specify that .(dot) matches line characters too, you have to specify
DOT_ALL flag using (?s) like “(?s)<Tag>.*</Tag>”

SuppressWarnings

One of the new built-in annotations in Java 5 is SuppressWarnings. You can use this annotation on all the available annotation levels (class, field, method, constructor, local variable, etc) to suppress warnings that might be generated by a compiler.

I typically use Eclipse and they provide the ability to “quick fix” a warning in some cases by adding a SuppressWarnings annotation, which looks something like this:
@SuppressWarnings("deprecation") and is placed before a method, field, class, etc. In this case, this annotation suppresses a deprecated access warning. You can put multiple values in there as well with an annotation like @SuppressWarnings({"unchecked", "deprecation"}).

I found need to use this recently on some 3rd-party generated code. Instead of needing to fix the modified code after every generation I was able to just add @SuppressWarnings("all") to the generated class and make my troubles go away. :) Well, at least to the extent that I cared about in this instance. In general, I’m a big fan of a shared set of compiler defaults and a no-warning policy, but generated code can be something of an exception.

One gotcha is that because warning messages are compiler-dependent, there is not a lot of information out there about what values are allowed. The language spec talks only about unchecked and deprecation as values. The Sun JDK has seven categories (as documented here): all, deprecation, unchecked, fallthrough, path, serial, and finally.

I did some more hunting and found a list of the allowed values in the Eclipse compiler (scroll to the very bottom), which adds quite a bit to the Sun categories. Couldn’t find much from other JVMs.

Source: http://tech.puredanger.com/2007/01/05/suppresswarnings/