I have recently moved all my websites, including Wordpress blogs, to a new VPS hosting, a SSD Cloud Hosting at DigitalOcean. It is important to keep my blogs up all the time as they are the money cows that keep generating incomes. If there are down for a few days due to the process transferring, I may have lost some earning as well as search engine crawlers might think my sites … [Read more...]
Java: How To Implement ungetc in Java
If you are a C or C++ programmer, you may familiar withe ungetc function in C. ungetc function is a very simple but useful function especially when your program need to read characters from a FILE stream for data parsing. You may encounter cases where you need to unread the character so that you can use that character when you pass in the FILE reference into another … [Read more...]
eGenting Programming Competition 2013
Another competition year has come! Get your programming skills polished and take the challenge! There are more prizes this year. Come eat for free (breakfast, lunch, tea break include) and registration is free. Remember to bring your weapons, books I meant :) … [Read more...]
SQL: How To Select Data With Same Values On Columns
Let say you have the following data in you database table t1 and you want to select the IDs for the row record that have the same value on COL1 and COL2. ID COL1 COL2 COL3 ====================== 1 100 200 300 2 200 300 400 3 100 200 500 4 300 300 300 5 200 300 400 And the expected result is ID = 1,2,3,5. The SQL to a … [Read more...]
Linux: How To Add Swap on CentOS
Linux divides its physical memory (or the RAM, random access memory) into chucks of memory called pages. When a program require more memory and there isn't enough physical memory, Linux will starts moving out inactive pages and store them on hard disk. The process of moving out the pages for physical memory to disk is called swapping. The size of "memory on disk" is … [Read more...]