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 API11 Jan 2007

How do I iterate a subset of a string?

package org.kodejava.text; import java.text.CharacterIterator; import java.text.StringCharacterIterator; public class IterateSubstringExample { private static final String text = "How razorback-jumping frogs can level six piqued gymnasts"; public static void main(String[] args) { CharacterIterator it = new StringCharacterIterator(text, 4, 27, 5); // In this loop we just iterator a subset of character defined in the // StringCharacterIterator above. […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API08 Jan 2007

How do I reverse a string using CharacterIterator?

In this example we use the java.text.CharacterIterator implementation class java.text.StringCharacterIterator to reverse a string. It’s done by reading a string from the last index up to the beginning of the string. package org.kodejava.text; import java.text.CharacterIterator; import java.text.StringCharacterIterator; public class StringCharacterIteratorReverseExample { private static final String text = "Jackdaws love my big sphinx of quartz"; public […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API05 Jan 2007

How do I iterate each character of a string?

The following example show you how to iterate each character of a string using the java.text.CharacterIterator and java.text.StringCharacterIterator to count the number of vowels and consonants in the string. package org.kodejava.text; import java.text.CharacterIterator; import java.text.StringCharacterIterator; public class StringCharacterIteratorExample { private static final String text = "The quick brown fox jumps over the lazy dog"; public […]

Wayan · 1 min read
JDBC / NOTES</>↗
JDBC01 Jan 2007

How do I disable auto-commit mode in JDBC?

The code snippet below shows you how to disable auto-commit operation when executing JDBC commands or queries. package org.kodejava.jdbc; import java.sql.*; public class AutoCommitSettingExample { private static final String URL = "jdbc:mysql://localhost/kodejava"; private static final String USERNAME = "kodejava"; private static final String PASSWORD = "s3cr*t"; public static void main(String[] args) { // DO: Get […]

Wayan · 2 min read
SERVLET / NOTES</>↗
Servlet28 Dec 2006

How do I read text file in Servlet?

This example show you how to read a text file in a servlet. Using the ServletContext.getResourceAsStream() method will enable you to read a file whether the web application is deployed in an exploded format or in a war file archive. The following servlet read the configuration.properties file from the /WEB-INF directory in our web application. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API28 Dec 2006

How do I create a scheduled task using timer?

This example show you how to create a simple class for scheduling a task using Timer and TimerTask class. package org.kodejava.util; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Timer; import java.util.TimerTask; public class TimerExample extends TimerTask { private final DateFormat formatter = new SimpleDateFormat("hh:mm:ss a"); public static void main(String[] args) { // Create an instance […]

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.