By changing the default administrator username of your Wordpress login can be a great security measure to help prevent unauthorized access to your WordPress admin dashboard. Your Wordpress site is at risk if you are still using the default username admin. Attackers, either a human being or a robot can use the username to attempt log into your Wordpress dashboard. It is … [Read more...]
Linux: How To Compress And Decompress Folders And Files
Sometime, you may want to compress all files in a folder (or folders) in Linux into a single file to save space and so that you can back up the file to other media. In Linux, you can use the tar utilities which is installed in most Linux distribution by default. GNU 'tar' saves many files together into a single tape or disk archive, and can restore individual files from the … [Read more...]
Java: How To Select Top N Objects From A List
There are several ways to select top N objects from A list in the order of multiple data members of an object. For example, you may select top 10 players (top scores) from a list ordered by the players' score_1, score_2 and then score_3. The Simplest Way But Ineffective The simplest way to pick the top N elements is to sort the whole list and get the top N elements. … [Read more...]
Java: How To Create A Simple Web Server Using HttpServer
To program a web or HTTP server from nothing could be very difficult. It's gonna to take you to write thousands of source instructions. The HTTP protocol it self is pretty to understand but it complicated to implement them in programming language. It involves a lot of parsing and need a lot of understanding how the HTTP requests and HTTP responses work together. … [Read more...]
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 do … [Read more...]