AUGUSTEN TECHNICAL

FRESHERS SHINE

Pages

Friday, 27 June 2014

Top 10 fixes for common PC problems

1. Attack of the Blue Screen of Death




You’re working on an important project, and suddenly your screen displays nothing but white text against a blue background. If it happens once, you curse, reboot, and hope for the best. But if you’re getting these BSODs frequently, you’ve got a problem that needs fixing.

Brewski13 had such a problem, and Iprovided advice for diagnosing, and hopefully fixing, the underlying cause.

2. How to recover deleted files


Now you see them, now you don’t. Files are like that sometimes.

So where are they? Are you sure you don’t have a backup somewhere? Files can hide in the Recycle Bin and “empty” sectors of your hard drive, even if you've deleted them.

Megan Aitken’s partner lost "a load of photos." I walked her, and other readers, through the steps toward recovery.

3. Introduction to backup



I don’t get a lot of questions about backup. I sure get a lot from people whoshould have backed up, though.

Scarcely a week goes by without at least one email from a terrified reader with a crashed disk or an overwritten file. I remember a grad student who lost a laptop with all the notes for his dissertation.

Rickaber asked the right question. Before disaster hit, he wanted someone to explain the basics of backing up. I was happy to oblige.


4. Protect your privacy while you browse




What once sounded like paranoia is now common sense. Steve asked for safe and secure ways to access the Internet without being tracked by crooks, corporations, and governments.

While there’s no such thing as complete, perfect privacy or security, you can use plenty of tricks to provide a reasonable degree of anonymity. You can use your browser’s private mode, then supplement that mode with the right add-ons. You can also replace that browser with one designed to keep your real self a secret. I explained the options.


5. Speed up a slow PC without buying new hardware

When Steve asked,

If a once-fast computer has slowed to a crawl, you can’t really blame the hardware. Sure, you can speed things up by adding RAM, upgrading the CPU, or replacing the hard drive with an SSD. But none of those solutions—all of which cost money—address the underlying problem. Your hardware isn’t necessarily underpowered. It’s probably just overloaded.
6. Is one antivirus program really better than two?


Arcticsid made the mistake of installing one antivirus program on a new PC that already had another.
Running two antivirus programs is a bit like mixing a fine, vintage Cabernet with breakfast cereal. Each is good in its own right, but the combination may have unpleasant side effects.

7. How to securely wipe sensitive files—or your entire hard drive



When you delete a file, the data doesn’t actually go away—even after you’ve emptied the Recycle Bin. The actual bits remain written on the drive until some other disk activity writes over them. Even when you format a drive, the files are still there for those who want and know how to read them.

That’s good news if you’ve lost some files. It's not so great if you truly want a file to go away, or if you’re giving away an old PC and to want make sure that your private records won’t be accessible. You have to take special steps to protect yourself.

8. An obscenely slow Internet connection when you’re paying for a fast one




Interronator was paying Time Warner for 20mbps Internet service, but was only getting about 0.7.

Almost no one gets the Internet performance that their ISP advertises, but the difference between advertised and real speed should be reasonably close.

Is the fault in your equipment, or is your ISP to blame? I provide step-by-step diagnostics to help you identify the bottleneck.

9. How to archive files so they’ll stay around for years




Nothing lasts forever, but you want at least some of your files to last a very long time. So it was no surprise when Daisky asked about making family photos available to future generations.

No one is really sure how long you can archive digital files so that your great-grandchildren will enjoy them. In fact, no one is really sure if it’s possible.

If you follow my suggestions, you’ll increase the odds of preserving your precious digital memories. But you won’t really be sure of your success for a few decades.

10. Actually, you do need to share your passwords



As I just said, nothing lasts forever. And that includes you and me.

When we die, loved ones will need access to our bank accounts, email accounts, and the encrypted parts of our computers. So, despite the generally good advice about not sharing passwords, there is one big exception. You must find someone you can trust with that information, and make sure they can access your various passwords.

Difference between StringBuilder and StringBuffer in Java

If you are in hurry and heading straight to interview then I won't take much of your time, In couple of words, main difference between StringBuffer and StringBuilder is between four parameters, synchronization, speed,thread-safety and availability.StringBuffer is synchronized and that's why thread-safe, but StringBuilder is not synchronized, not thread-safe and that's why fast. Regarding availability, StringBuffer is available from Java 1.0 while StringBuilderwas added on Java 5. Now we can take a breath, and can continue with rest of this article. In Java, there are three classes to deal with String data type, String, StringBuffer and StringBuilder. All of three belongs to java.langpackage, which is automatically imported to every Java program thus you don't need to do any import for using StringBuilder and StringBuffer. Out of these three, String is immutable in Java, while StringBuilder and StringBuffer are mutable version of String. Some one with little bit of common sense will think that, why do one need three classes for same functionality, why can't String just do what StringBuilder and StringBuffer does. This definitely would have required keeping String mutable, which is not favourable to Java designers for many reasons, like Security, String Pool, and Performance. So designers of Java API has introduced a pattern of providing a mutable companion class for immutable main class. StringBuffer was introduced along with String from very first version of Java API, the JDK 1.0, while StringBuilder was introduce quite late in early 2000s when Java 1.5 was released.

Thursday, 5 June 2014

Right way to check if String is empty in Java

What do you most of us do while using String in Java? checking whether String is null or empty right? I am sure you know couple of way to test whether String is empty or not, but do you know the right way to do it? When we talk about Strings in Java, we can imagine them as arrays of characters, and they are, but in Java they are also object. An empty Java String, is considered as the not null String that contains zero characters, meaning its length is 0. However, a Java String that might only contain the white-space character is not considered as empty, it is considered to contain one character and its length is equal to 1. One of the most popular way ofchecking whether String is empty or not is String class' isEmpty() method, this looks perfect right, it's readable and returns boolean if String is empty otherwise returns false, but problem is you can not call this method without checking whether String is null or not. In another word, this is not null safe and it will throw NullPointerException if String is null. Another popular and faster wayto check if String is empty or not is by checking it's length, e.g. if String.length() = 0 then String is empty, but this is also not null safe. Third common way of checking emptiness of String in Java is comparing it with empty String literal e.g. "".equals(str),this method is not as fast as previous two but it is null safe, you don't need to check for null, in case of null it will return false. So in my opinion, this is the right way to check if String is empty or not. If you definition of empty String also includes null then you can also use Apache Commons Lang's StringUtils class. It has methods like isEmpty() which return true for both null and empty String literal. Again this is also null safe and will not throw NullPointerException.