Categories

Custom Java Events

To create custom Java events we need basicly three classes:

The event class which will be fired
An interface which indicating responsibility of event listeners of this event
The class which fires the Java events

When these classes are prepared, other classes can subscribe to events  by providing their event listener.

An event class must extend java.util.EventObject class. Below you [...]

Basketball Game: Robot (www.onlinegames.com/basketball/)

I have coded another helper program to a popular game using Robot class of Java. In this game, players are trying to score baskets in a 2d pitch by shooting the ball random positions to a basket of which position remains unchanged. The players only decide highest point of the path of the ball. By [...]

DL – Safe SWRL Rules on OWL DL Ontologies with Pellet

Here is a simple example to understand the meaning of DL Safety.

In a DL Safe rule execution, only explicitly named individuals are bound to the variables in the rule.

Lets say we have a transitive object property named ancestorOf.

Can we simulate this transitivity using a DL-Safe SWRL rule rather than defining the ancestorOf property as transitive?

At [...]

Setting Java Character Encoding

When operations on different character sets need to be done in Java, we need to initialize JVM with required options.

First lets have a look at basics of java character encodings.

Internally the JVM always operates with Unicode.
Data transferred in or out of the JVM is converted to a format specified in the file.encoding property of the [...]