Java: Use ByteBuffer As InputStream
Sometime, your program may need to read data from a ByteBuffer buffer into a InputStream object. There is no class in Java library that provide the facility to do the conversion.
Anyway, to use a ByteBuffer object as an InputStream is pretty simple. What you need to do is to write a class wrapper that inherit InputStream and override the read() function in InputStream.
100th Posts For Snippet IT
Finally, this blog has reached 100 posts! Yeah!
It really takes a long time for me to do this because I'm not blogging this site full timely. Second, sometime I'm just out of idea what to blog.
I will try work harder to share more information on programming and anything related to information technology in this new year. Thanks for reading!
Java: Format Integer Into Fixed Width String
Sometime, you may want to format an integer or a long value into a fixed width String. You need to display the value in fixed width especially in reports where you want to keep the numbers in aligned (e.g. 3456 as 0003456 and 1234 as 0001234).
Other than that, you may also want to format the integer value for a better visibility. For example, to display integer value as a document number (e.g. 12345678 as 00-01234-5678), for example an account number.
The Java.format() is not flexible enough to solve my problem. At least it cannot be used to format a fixed length document number in the format I want: XX-XXXX-XXXX. Therefore I decide write my own format function.
Happy Holidays from your Google team!
I just got a greeting card from Google Team. Do you have one?


The email entitles "Happy Holidays from your Google team!". Opps... when do I have a Google Team that works for me? Ha ha.
Anyway thank you Google! Happy Holiday too.
Google Wave Invitation Giveaway
I got my free Google Wave invitation from LiewCf, thanks for the invitation! Ok, now is my turn to give you guys, my blog readers, the free invitations.

Wordpress: Version 2.9
The latest Wordpress version 2.9 is now available for download. The new Wordpress has a new codename - Carmen - which is named in honor of magical jazz vocalist Carmen McRae (whom were added to the Last.fm WP release station).

Adobe Acrobat Reader: Possible Security Vulnerability When Acrobat JavaScript Is Enabled
It is possible to have security vulnerability in Adobe's Acrobat Reader if the Acrobat Javascript option is enable.
When the option is enabled and you open a crafted PDF file with Adobe Reader that allows JavaScript execution, your computer will be exposed to security risk - hacker may able to access your valuable data from your hard disk.
Java: Continuously Read Data From FileChannel Without MappedByteBuffer
When programmer writes a program to read data from a file continuously and sequentially with a fixed data type reading sequence (e.g. to read three integers then 2 doubles repeatedly), he or she may find the MappedByteBuffer from Java library is useful.
Short URL: Top 5 Websites That Provide Free Short URL Service
What is a "short URL"? Short URL or tiny URL is an URL used to represent a long URL For example, http://tinyurl.com/45lk7x can be used to represent and will be used to redirect to http://www.snippetit.com/2008/10/implement-your-own-short-url.
Why people use short URL? First, because it is easy to remember. Imagine when you read an article on a magazine or newspaper that shows you a site with 100 characters and complicated URL. How can you remember the long URL, put down the magazine or newspaper, sit in front of your computer and type out the URL at web browser correctly? When the URL is short, for example tinyurl.com/45lk7x, you can do it easily.
Second, short URL is more portable. For instance, when you want to send your friend a SMS that contains some message and an URL, with short URL you can save a lot of space and give you more space to type your message.

Wordpress: Catch A Spam Comment With Statcounter
Sometime your Wordpress' anti spam software (e.g. Akismet) may not able to stop all the comment spam because the comment looks too real to it and to human too. In this case, you will need to identify the comment whether it is actually a real comment or it is automatically submitted by software.
Someone who made a comment must have visited your site. That's it, if he or she has not visited your site but his or her comment is posted on one of your post. Then it is very high possibility that the comment is a spam comment.
How do you ensure someone who left a comment on your blog actually visited your site? The best way to do it is by looking at the IP address where the computer submitted the comment.