CORE API / NOTES</>↗Core API23 Oct 2019
The following code snippet shows you how to remove time information from the java.util.Date object. The static method removeTime() in the code snippet below will take a Date object as parameter and will return a new Date object where the hour, minute, second and millisecond information hasbeen reset to zero. To do this, we use […]
OS X / NOTES</>↗OS X28 Mar 2019
Here are the instructions to install Microsoft Consolas Font on Mac OS X. You need to install brew first. Type-in the following commands. brew install cabextract cd ~/Downloads mkdir Consolas cd Consolas curl -LO https://sourceforge.net/projects/mscorefonts2/files/cabs/PowerPointViewer.exe cabextract PowerPointViewer.exe cabextract ppviewer.cab open CONSOLA*.TTF Press Install Font button to install the fonts.
TOOLS / NOTES</>↗Tools14 Feb 2019
You have typed a long line of command in terminal. But now you want to clear or delete the entire line. Deleting each character in the command will take sometime and bored you. So are there any keyboard shortcuts that allow you to do this? Yes there are some hotkeys to the rescue. Hotkeys Description […]
APACHE COMMONS / NOTES</>↗Apache Commons06 Feb 2019
The following code snippet demonstrates how to use RandomStringGenerator class from the Apache Commons Text library to generate random strings. To create an instance of the generator we can use the RandomStringGenerator.Builder() class build() method. The builder class also helps us to configure the properties of the generator. Before calling the build() method we can […]
BASIC / NOTES</>↗Basic29 Jan 2019
The ArrayIndexOutOfBoundsException exception is thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array. For example see the code snippet below: String[] vowels = new String[]{"a", "i", "u", "e", "o"} String vowel = vowels[10]; // throws […]
MYSQL / NOTES</>↗MySQL17 Jan 2019
Introduction There are times when you need to create a user only to have read-only access to a database. The user can view or read the data in the database, but they cannot make any changes to the data or the database structure. Creating a New User Account To create a read-only database user account […]