Generate Random Password in Java

January 16th, 2009 4 comments

This article demonstrates how to generate random password or string using java.util.Random.

You can define your own set of characters in this string variable

private static final String charset = "!0123456789abcdefghijklmnopqrstuvwxyz";

Class: RandomPassword.java
Read more…

Categories: Programming

Use Calendar instead of Date in Java

January 14th, 2009 No comments

Common Issue

When you use java.util.Date object with JDK version higher than 1.1

Date d = new Date();
d.getMonth();

You will get deprecated warning messages when you try to compile

The method getMonth() from the type Date is deprecated

However you can supress the warning message by adding @SuppressWarnings("deprecation") to you main() method

@SuppressWarnings("deprecation")
public static void main(String[] args) {
    ...
}

or adding @SuppressWarnings("unchecked") to other method

@SuppressWarnings("unchecked")
public void otherMethod() {
    ...
}

Note that this can only be used in JDK 5.0+

Alternative

Now let’s forget about working around the deprecated method, let’s learn how to use java.util.Calendar instead
Read more…

Categories: Programming

What are Java Operators?

January 12th, 2009 No comments

In Java Language, there are 4 types of operators

  1. Arithmetic
  2. Relational
  3. Logical
  4. Bitwise

The rest of this post includes a small class to demonstrate on how those operators are used.

Arithmetic Operators

+  : Addition

-  : Subtraction

*  : Multiplication

/  : Division

%  : Modulus

++ : Increment

-− : Decrement

Read more…

Categories: Programming

How to repeat print Column or Row in MS Office Excel?

January 10th, 2009 No comments

The scenario that I came across is, when I am working on a excel file which required to present in multiple page print out, I will need to keep showing every column on each page printed out. Ok, how do I achieve that?

In this post, I will show you how to get around it.

Say you have data similar to the Screenshot below

screenshot-excel-repeat-print-rc-01

In printed out on A4 paper size, there will be 2 pages. Page 1 will include Task Item column, Page 2 will not inlcude Task Item column. Now follow steps below to get repeat print column
Read more…

Categories: FAQ & Tip

How to connect to Linux from another PC via SFTP?

January 8th, 2009 No comments

This tutorial is showing you how to setup secured ftp connection from another machine to Linux. In this demonstration purpose, I am going to use Windows XP and Ubuntu 8.10 Server.

The rest of this post will take you through

  • Requirements
  • Installation
  • Setup connection

Requirements

  • SSH Server
  • SFTP Client

Read more…

Categories: FAQ & Tip, Software

Installing IIS Server on Windows XP

January 4th, 2009 No comments

To set up your own web server is not a hard thing to do. This post is showing you how to install IIS (Internet Information Server) on Windows XP and get your first welcome page up and running.

IIS server is shipped with Windows XP, you do not need to download or use any other third party software.

Table of Content

  • Requirement
  • Installing
  • Setup Website
  • Testing

Read more…

Categories: FAQ & Tip

4 Free Antivirus Software

January 3rd, 2009 No comments

For a basic computer virus protection for your home pc, you don’t need to spend a cent on anti-virus software. There are 4 of them to choose from.

  1. AVG Free Edition
  2. Avast! Home Edition
  3. BitDefender Free Edition
  4. ClamWin

Read more…

Categories: Software

How to set ClearType font on Windows XP?

January 1st, 2009 No comments

By default Windows XP does not enable Clear Type Font. You have to set it manually. You can do this one of the two methods

  1. Change Desktop Properties Settings
    Recommended for normal users
  2. Edit Windows Registry
    Recommended for Advanced users

Let’s get start

Change Desktop Properties Settings

  • Right Click on your desktop
  • Display Properties Windows appears
    Screenshot - setcleartype-01
  • Click on Effects button
  • Effects Windows appears
    Screenshot-setcleartype-02
  • Select Clear Type
  • Click OK button
  • Click OK button again on Display Properties Windows

Read more…

Categories: FAQ & Tip

25 Free Useful Apps for Software Developers

December 31st, 2008 No comments

Are you Software Developer? if yes, you might find this post useful. You could find free apps which I believe they are used most by other developers out there.

This post will take you to list of software under the following categories

  • Integration Development Environment (IDE)
  • Text Editor and Comparison
  • Databases Engine, Client and Server
  • File Archive and Transfer
  • Virtual Machine
  • Graphics and GUIs

Read more…

Categories: Software

Upgrade WordPress using Export and Import tool

December 29th, 2008 No comments

After looking through forums, I saw a lot of people (including myself) experienced a bad time with wordpress upgrade where thing doesn’t always happen in the way you expected to happen, either the whole thing get screwed up or not 100% working in the way it should be. The worst thing is they could not revert back the old working version.

If you have similar problem above, maybe this post is a great tip for you. This will also be a good post for my future reference. I have used this method when I upgrading this website (computer-faqs.com).

Table of Content

  • Before upgrade
  • Upgrade
    • Export
    • Install
    • Import
  • After upgrade
  • Prepare to go live
  • Simple Rollback
  • Summary

Read more…

Categories: FAQ & Tip