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.

JDBC / NOTES</>↗
JDBC25 Oct 2006

How do I retrieve values from ResultSet?

Here is another example on how to read data from a ResultSet returned by executing an SQL query in a database. We start by creating a connection to the database. Creates a PreparedStatement to execute a query to get some data from the books table. After executing the PreparedStatement we will have a ResultSet object. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API21 Oct 2006

How do I know the minimum and maximum number in an array?

package org.kodejava.util; import java.util.Arrays; import java.util.Collections; public class ArrayMinMax { public static void main(String[] args) { // Creates an array of integer numbers in it. Integer[] numbers = {8, 2, 6, 7, 0, 1, 4, 9, 5, 3}; // To get the minimum or maximum value from the array we can // use the Collections.min() […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API20 Oct 2006

How can I change file attribute to writable?

Prior to Java 1.6 the java.io.File class doesn’t include a method to change a read only file attribute and make it writable. To do this on the old days we have to utilize or called operating system specific command. In Java 1.6 a new method named setWritable() was introduced to do exactly what the method […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API19 Oct 2006

How can I change file attribute to read only?

This code demonstrate how we can modify file attribute to be read only. File class has a setReadOnly() method to make file read only and a canWrite() method to know whether it is writable or not. package org.kodejava.io; import java.io.File; public class FileReadOnlyExample { public static void main(String[] args) throws Exception { File file = […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API14 Oct 2006

How do I know the memory size in virtual machine?

If you want to know the free memory, and the total memory available in the Java runtime environment then you can use the following code snippet to check. package org.kodejava.lang; public class MemoryExample { public static void main(String[] args) { long freeMemory = Runtime.getRuntime().freeMemory(); long totalMemory = Runtime.getRuntime().totalMemory(); System.out.println("Free Memory = " + freeMemory); System.out.println("Total […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API14 Oct 2006

How do I ping a host?

Since Java 1.5 (Tiger) the java.net.InetAddress class introduces isReachable() method that can be used to ping or check if the address specified by the InetAddress is reachable. package org.kodejava.net; import java.net.InetAddress; public class PingExample { public static void main(String[] args) { try { InetAddress address = InetAddress.getByName("172.16.2.0"); // Try to reach the specified address within […]

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.