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 API05 Sep 2006

How do I get a part or a substring of a string?

The following code snippet demonstrates how to get some part from a string. To do this we use the String.substring() method. The first substring() method take a single parameter, beginIndex, the index where substring start. This method will return part of string from the beginning index to the end of the string. The second method, […]

Wayan · 2 min read
BASIC / NOTES</>↗
Basic02 Sep 2006

How do I get the command line arguments passed to the program?

When we create a Java application we might want to pass a couple of parameters to our program. To get the parameters passed from the command line we can read it from the main(String[] args) method arguments. To make a class executable we need to create a main() method with the following signatures: public static […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API01 Sep 2006

How do I get operating system temporary directory / folder?

To get the location of temporary directory we can use the System.getProperty(String) method and pass a property key "java.io.tmpdir" as the argument to the method. package org.kodejava.lang; public class TempDirExample { public static void main(String[] args) { // This is the property name for accessing OS temporary directory // or folder. String property = "java.io.tmpdir"; […]

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

How do I create a copy of a file?

This example shows how we can use the Apache Commons IO library to simplify a file copy process. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; public class FileCopyExample { public static void main(String[] args) { // The source file name to be copied. File source = new File("README.md"); // The target file name to […]

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

How do I convert day-of-year to day-of-month?

package org.kodejava.util; import java.util.Calendar; public class DayYearToDayMonth { public static void main(String[] args) { // Create an instance of calendar for the year 2017 and set the // day to the 180 day of the year. Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2021); cal.set(Calendar.DAY_OF_YEAR, 180); // Print the date of the calendar. System.out.println("Calendar date is: " […]

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

How do I check if a year is a leap year?

The following example using the GregorianCalendar.isLeapYear() method to check if the specified year is a leap year. package org.kodejava.util; import java.util.GregorianCalendar; public class LeapYearExample { public static void main(String[] args) { // Here we show how to know if a specified year is a leap year or // not. The GregorianCalendar object provide a convenient […]

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.