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.

JODA-TIME / NOTES</>↗
Joda-Time02 Feb 2012

How do I get the last day of a month in Joda-Time?

This example show us how to use Joda-Time’s DateTime class to get the last day of the month. To get the last day of the month we first need to find out the last date of the month. To do this, create a new instance of a DateTime. From the DateTime object get the day-of-the-month […]

Wayan · 2 min read
JODA-TIME / NOTES</>↗
Joda-Time01 Feb 2012

How do I create DateTime object in Joda-Time?

The following example show you a various way to create an instance of Joda-Time’s DateTime class. By using the default constructor we will create an object with the current system date time. We can also create the object by passing the information like year, month, day, hour, minutes and second. Joda can also use an […]

Wayan · 2 min read
JODA-TIME / NOTES</>↗
Joda-Time01 Feb 2012

How do I use Joda-Time’s DateMidnight class?

The org.joda.time.DateMidnight class represent a date time information with the time value set to midnight. The following snippet show you how to instantiate this class. package org.kodejava.joda; import org.joda.time.DateMidnight; import org.joda.time.format.DateTimeFormat; public class DateMidnightDemo { public static void main(String[] args) { // Create DateMidnight object of the current system date. DateMidnight date = new DateMidnight(); […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API16 Jan 2012

How do I create array of unique values from another array?

This code snippet show you how to create an array of unique numbers from another array of numbers. package org.kodejava.lang; import java.util.Arrays; public class UniqueArray { /** * Return true if num appeared only once in the array. */ public static boolean isUnique(int[] numbers, int num) { for (int number : numbers) { if (number […]

Wayan · 1 min read
XML / NOTES</>↗
XML11 Jan 2012

How do I get attributes of element during SAX parsing?

This example show you how to get the attributes of elements in an XML file using the SAX parser. package org.kodejava.xml; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.InputStream; public class SAXElementAttribute { public static void main(String[] args) { SAXElementAttribute demo = new SAXElementAttribute(); demo.run(); }...

Wayan · 2 min read
XML / NOTES</>↗
XML10 Jan 2012

How do I handle error when parsing an XML file using SAX?

The ErrorHandler interface implemented by the org.xml.sax.helpers.DefaultHandler class provides some methods for error handling mechanism in SAX parsing. The methods are warning(), error(), and fatalError(). package org.kodejava.xml; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import java.io.InputStream; public class SAXErrorHand...

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