SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

CORE API / NOTES</>↗
Core API18 Aug 2006

How do I calculate difference in days between two dates?

In the following example we are going to calculate the differences between two dates. First, we will need to convert the date into the corresponding value in milliseconds and then do the math, so we can get the difference in days, hours, minutes, etc. For example to get the difference in day we will need […]

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons13 Aug 2006

How do I count word occurrences in a string?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class WordCountDemo { public static void main(String[] args) { // We have the source text we'll do the search on. String source = "From the download page, you can download the Java " + "Tutorials for browsing offline. Or you can just download " + "the example."; // The word […]

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons09 Aug 2006

How do I reverse a string, words or sentences?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class StringReverseDemo { public static void main(String[] args) { // We have an original string here that we'll need to reverse. String words = "The quick brown fox jumps over the lazy dog"; // Using StringUtils.reverse we can reverse the string letter by letter. String reversed = StringUtils.reverse(words); // Now […]

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons05 Aug 2006

How do I check if a string is empty or not?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class EmptyStringCheckDemo { public static void main(String[] args) { // Create some variable to hold some empty string, contains only // whitespaces and words. String one = ""; String two = "\t\r\n"; String three = " "; String four = null; String five = "four four two"; // We can […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API04 Aug 2006

How do I convert Date to String?

package org.kodejava.text; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; public class DateToString { public static void main(String[] args) { // Create an instance of SimpleDateFormat used for formatting // the string representation of date (day/month/year) String pattern = "dd/MM/yyyy"; DateFormat df = new SimpleDateFormat(pattern); // Ge...

Wayan · 1 min read
CORE API / NOTES</>↗
Core API30 Jul 2006

How do I get day of week?

In this example we want to create a calendar or date from a year and day of the year. Next we will find out what day-of-week that calendar or date represent. In the code snippet below we are trying to find the 180 day of the year 2021. Let’s see the example below. package org.kodejava.util; […]

Wayan · 1 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.