Author

Git – How to Ignoring files Globally and Locally
Git – How to Ignoring files Globally and Locally

.gitignore Create a file, and name it as .gitignore in the root directory, then add names and patterns for any files and directories that should not be added to the repository. Use asterisk (“*”) as a wildcard. E.g. “*.class” will ignore all files that have the “.class” extension. Remember to add the .gitignore file to the repository so that... » read more

Kotlin – Regulate a set of broadcasts to listener via Mediator Pattern
Kotlin – Regulate a set of broadcasts to listener via Mediator Pattern

The definition of “mediator” is, a person who attempts to make people involved in a conflict come to an agreement; a go-between. Problem Solution The Mediator pattern suggests that all direct communication should be ceased between the components. Instead, these components must collaborate indirectly, by calling a special mediator object that redirects the calls to... » read more

Kotlin – Tips & Tricks
Kotlin – Tips & Tricks

You may try this with Kotlin Playground -> https://play.kotlinlang.org Swap two values w/o temp variable a = b.also { b = a } is equivalent to followings: Enum Reverse Look-up

Kotlin – Idiomatic Way to Deal with Null-able
Kotlin – Idiomatic Way to Deal with Null-able

In Kotlin, a null-able value without being sure it is not null cannot be accessed. (Checking for null in conditions), or asserting that it is surely not null using the !! sure operator, accessing it with a ?. Safe Call, or lastly giving something that is possibly null a default value using the ?: Elvis... » read more

Kotlin – Use EnumSet For RBAC
Kotlin – Use EnumSet For RBAC

Enumset is a powerful collection in Java to replace bit fields. This article will explains how to use EnumSet to create a RBAC (Role-Based Access Control). Now, let’s see how we can use EnumSet to create a RBAC. Inside the setup method, a series of roles with specific access right in a given system has been defined... » read more

Java – Why you should use Optional
Java – Why you should use Optional

To Overcome NullPointerException The Java 8’s Optional is meant for alleviating the occurrence of NullPointerException. NullPointerException is the result of Null References, Null Reference is also known as The Billion Dollar Mistake. The Billion Dollar mistake was coined by a British computer scientist, Sir Charles Antony Richard Hoare. Null pointers are the single biggest source... » read more