SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

KOTLIN / NOTES</>↗
Kotlin12 May 2018

How do I write Hello World in Kotlin?

In Kotlin, the HelloWorld.kt program can be written as a simple function like the following snippet. fun main(args: Array<String>) { println("Hello, World!") } From this little code snippet we can learn the following features of the Kotlin programming language: Kotlin program saved in a file with .kt extension. The fun keyword to declare a function […]

Wayan · 2 min read
OS X / NOTES</>↗
OS X13 Nov 2017

How do I set the default Java (JDK) version on Mac OS X?

In this post you will learn how to set the default JAVA_HOME in Mac OS X when you have more than one JDK installed in your computer. First you need to run /usr/libexec/java_home -V command to get the list of installed JDK. The command will print out something like the following depending on the available […]

Wayan · 2 min read
TOOLS / NOTES</>↗
Tools16 Oct 2017

How do I pass password to sudo commands?

If you want to run a sudo command without being prompted to input the password you can do the following command. echo password | sudo -S rm -rf /opt/jetty/ In the command above we are trying to remove the /opt/jetty directory using the rm -rf command. The -S (stdin) option allow the sudo command to […]

Wayan · 1 min read
JACKSON / NOTES</>↗
Jackson14 Feb 2017

How to pretty print JSON string using Jackson?

The following example demonstrates how to pretty print the JSON string produces by Jackson library. To produce well formatted JSON string we create the ObjectMapper instance and enable the SerializationFeature.INDENT_OUTPUT feature. To enable this feature we need to call the enable() method of the ObjectMapper and provide the feature to be enabled. ObjectMapper mapper = […]

Wayan · 4 min read
JAVA 8 / NOTES</>↗
Java 813 Feb 2017

How to convert java.time.LocalDate to java.util.Date?

The following code snippet demonstrate how to convert java.time.LocalDate to java.util.Date and vice versa. In the first part of the code snippet we convert LocalDate to Date and back to LocalDate object. On the second part we convert LocalDateTime to Date and back to LocalDateTime object. package org.kodejava.datetime; import java.time.*; import java.util.Date; public class LocalDateToDate […]

Wayan · 2 min read
JACKSON / NOTES</>↗
Jackson13 Feb 2017

How to format LocalDate object using Jackson?

We have a Recording class which has a Java 8 java.time.LocalDate property. We need to deserialize and serialize this property from and to JSON string. To do this we can use the @JsonDeserialize and @JsonSerialize annotations to annotate the LocalDate property of the Recording class. @JsonDeserialize(using = LocalDateDeserializer.class) @JsonSerialize(using = LocalDateSerializer.class) private LocalDate releaseDate; To […]

Wayan · 3 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.