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.

APACHE POI / NOTES</>↗
Apache POI15 Dec 2008

How do I create an Excel document using Apache POI?

This example demonstrate how to create an Excel document using Apache POI library. In this example we create a simple document containing two sheets which have a value on their first cell. package org.kodejava.poi; import org.apache.poi.hssf.usermodel.*; import java.io.FileOutputStream; import java.io.IOException; public class CreateExcelDemo { public static void main(String[] args) { // Creating an instance of […]

Wayan · 2 min read
ITEXT PDF / NOTES</>↗
iText PDF14 Dec 2008

How do I create a PDF document using iText PDF?

This example is the first example of the iText PDF series, we are going to start by learning to use the iText PDF library to create a PDF document. We will see how to use the Document class, getting an instance of PdfWriter, creating a simple Paragraph and set the text alignment and the font. […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API11 Dec 2008

How do I detect non-ASCII characters in string?

The code below detect if a given string has a non ASCII characters in it. We use the CharsetDecoder class from the java.nio package to decode string to be a valid US-ASCII charset. package org.kodejava.io; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharacterCodingException; import java.nio.CharBuffer; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.Arrays; public class NonAsciiValidation { public static void main(Str...

Wayan · 2 min read
HIBERNATE / NOTES</>↗
Hibernate09 Dec 2008

How do I use Hibernate’s Restriction.in criterion?

This example demonstrate the use of Hibernate’s Restriction.in criterion. This restriction will query for some record based on a collection of parameter defined for a specific property of the bean. package org.kodejava.hibernate; import org.hibernate.SessionFactory; import org.hibernate.Session; import org.hibernate.HibernateException; import org.hibernate.Criteria; import org.hibernate.cfg.Configuration; import org.hibernate.criterion.Restrictions; import org.kodejava.hibern...

Wayan · 2 min read
CORE API / NOTES</>↗
Core API07 Dec 2008

How do I create temporary file?

A temporary file can be created by using java.io.File.createTempFile() method. It accepts the prefix, suffix and the path where the file will be stored. When no path is specified it will use the platform default temporary folder. The name of the temporary file will be in the form of prefix plus five or more random […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API05 Dec 2008

How do I add hours, minutes or seconds to a date?

This example shows you how to add or subtract hours, minutes or seconds to a date using the java.util.Calendar object. package org.kodejava.util; import java.util.Calendar; public class DateAddSubtract { public static void main(String[] args) { // Gets a calendar using the default time zone and locale. The // Calendar returned is based on the current time […]

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.