Spring Constructor Injection

Spring Constructor Injection is a form of Dependency Injection where the objects are injected into the client using the client constructor. Example of Spring Constructor injection Github – Source Code for this example In typical software development, classes collaborate with each other to achieve the desired functionality. e.g. In an ATM (Automated Teller Machine) system, … Read more

Execute R from Java

Introduction This page describes how to install the eclipse plugin that helps calling R from Java using JRI. This tutorial describes the Java Wrappers for R objects. Lets now look at the following Calling R functions from java Assigning values to R objects from Java Retrieving values from R into Java Calling R functions from … Read more

RServe – Introduction and Installation

Related Tutorials First Sample Program Introduction RServe is an R package that allows other applications to talk to R using TCP/IP. It creates a socket server to which other applications can connect. RServe provides client implementation for common languages such as C/C++, Java and PHP. In this series of tutorials we will look at how … Read more

Pretty printing in R using the Format function.

In the previous tutorial we looked at printing R objects using the print and cat functions. In this tutorial we look at Pretty printing in R using the Format function.. If R encounters a custom object then it calls the toString() generic method of that object. The sprintF method is a wrapper over C’s sprintf … Read more

Source R File

In this tutorial we look at how to Source R File from the console. R commands can be run from a file using the source command. create a test file called test.R vi test.R add the following line in the file cat(“Sourcing from R file\n”) Now open R and fire this command (give the absolute … Read more

Java XML – JDOM2 – Outputter

Introduction In the earlier tutorials we looked at how to create a JDOM2 document from SAX ,DOM and StAX. In this tutorial we learn how to output JDOM2 as XML, DOM, SAX, StAXEvent and StaxStream. Lets look at the important classes Important Classes XMLOutputter – This is probably the most useful outputter. It outputs the … Read more

Java XML – JDOM2 – Filters

JDOM2 has three methods that accepts Filters while obtaining data. The three methods are &ltE extends Content&gt List&ltE&gt getContent(Filter&ltE&gt filter); &ltE extends Content&gt List&ltE&gt removeContent(Filter&ltE&gt filter); &ltE extends Content&gt IteratorIterable&ltE&gt getDescendants(Filter&ltE&gt filter); Filters are also extensively used in the JDOM2 XPath API, especially to ‘coerce the xpath result data in to the generic-typed results’. See … Read more

Java XML – JDOM2 – DOMBuilder

Buliding JDOM2 documents from w3c DOM JDOM2 provides a DOMBuilder that can be used to build a JDOM2 Document from a org.w3c.dom.Document. If there are namespace declarations in the xml document then make sure that while parsing the XML document the setNamespaceAware method of the DocumentBuilderFactory is set to true. Before we look at an … Read more