Gmail is great and comes with a lot of useful features like labeling and filter to let your organize your mail box. Although these features are great but they work according to preset or static values. They are not smart enough. It becomes a problem when you have too much of unread emails. What if a bunch of emails come in at the same time? It could be a pain to find out … [Read more...]
Unix Shell Script: How to Receive Input Right After Echoing A Line
For example, say I echo a line of text in shell script and I want to receive user input just right after the text (not in the next line). The are several ways to do it: Method 1 echo "Enter a value: \c" read value Method 2 echo -n "Enter a value: " read value Method 3 read -p "Enter a value: " value … [Read more...]
Database: CHAR and VARCHAR – What are the differences?
Most programmers may already know the main different between CHAR and VARCHAR - The first one supports fixed-length data and the second one supports variable-lengths of data. Some people may think, since VARCHAR can do what CHAR does, then why we still need CHAR in our database design. I even have heard one of the very experienced Oracle database administrator say "Nowadays … [Read more...]
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. … [Read more...]
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! … [Read more...]