Generate metadata for a dataset in R

Generate metadata for a dataset in R

Looking at some data in R is a crucial part of any analysis. Even before we start with anything we want to understand the data in hand. Sometimes our datasets are too big to look at each column one by one. Here comes an easy way to generate metadata for your dataset. Although there are various aspects and features you may want to look at, still there are few common that you can look with a simple utility package called metadata…

Read More Read More

Java Version Features (A brief History)

Java Version Features (A brief History)

A popular interview question for any Java Developer is “what was new in Java version X?” and if you mention that you have worked with 2 different versions of Java then it’s very likely to have a followup question “what was added in the later one?”. So here are the important new features added in each major Java release with their code names(At least I was asked for code name once). Java Version SE 8 Features forEach() method in Iterable interface default…

Read More Read More

Introduction to ORM (Hibernate)

Introduction to ORM (Hibernate)

Hibernate, If you are a Java developer I am sure you heard this name already. Yes! it is one of the ORMs available in the market. ORM tool or you can say an ORM Frameworks stands for Object Relational Mapping. If you have never worked with any ORM tool then your project structure will be like this   As you have used JDBC for a long time and we know that it is very powerful API for a Java developer…

Read More Read More

Fetch Whole Database in one Query in hibernate

Fetch Whole Database in one Query in hibernate

Hibernate is most widely used ORM tool for Java (at least by the time I am writing this). It has lot’s of Awesome feature and tricks to manage Entities, Implicit Inheritance is one of them. You can use a parent to fetch some entity and it will load it’s some entities. Key: Every entity is a subclass of Object class. If you create criteria for Object class you will get all the entities data. Session session = factory.openSession(); List l=session.createCriteria(Object.class).list();…

Read More Read More

Starting Apache Velocity with struts

Starting Apache Velocity with struts

What is Velocity? Ans: Velocity is a Java-based template engine. It permits anyone to use a simple yet powerful template language to reference objects defined in Java code. When Velocity is used for web development, Web designers can work in parallel with Java programmers to develop web sites according to the Model-View-Controller (MVC) model, meaning that web page designers can focus solely on creating a site that looks good, and programmers can focus solely on writing top-notch code. Velocity separates Java…

Read More Read More

Date Converter for Different Timezone and Formats

Date Converter for Different Timezone and Formats

Convert Date from one timezone to another without hassle. Covert a different format to different format. Features:- 1. Easy to use. 2. Free of cost. 3. Lightweight. 4. Pure Java tool. If you want to calculate your age or want to know how much younger or older your friend than you, Have a date in a different timezone and want to know the time in your timezone or what time in different timezone now. All this is just one download…

Read More Read More

Not In query In Liferay Dynamic Query

Not In query In Liferay Dynamic Query

In Liferay dynamic query you can create a query for not in condition like     SELECT * FROM traders WHERE traderId NOT IN(455,466) dynamicQuery.add(PropertyFactoryUtil.forName("primaryKey.traderId") .notIn(StatutoryLocalServiceUtil.dynamicQuery() .add(PropertyFactoryUtil.forName("primaryKey.traderId").eq(455)) .add(PropertyFactoryUtil.forName("primaryKey.traderId").eq(456)) .setProjection(ProjectionFactoryUtil.property("primaryKey.traderId"))));  

Convert Amount In Words

Convert Amount In Words

A simple problem is to convert the given number into words for receipt or other bills related usage. import java.util.*; public class AmountInWords { private static String amount; private static int num; private static String[] units = { “”, ” One”, ” Two”, ” Three”, ” Four”, ” Five”, ” Six”, ” Seven”, ” Eight”, ” Nine” }; private static String[] teen = { ” Ten”, ” Eleven”, ” Twelve”, ” Thirteen”, ” Fourteen”, ” Fifteen”, ” Sixteen”, ” Seventeen”,…

Read More Read More

Environment Variables In Java

Environment Variables In Java

  Environment Variables  are variables that are added in any Operating system that can be accessed from anywhere in OS without using the complete(Real) location.   In a java Application System.getenv(); is used to find out the system environment variables Example:- import java.util.Map; public class EnvMap { public static void main (String[] args) { Map<String, String> env = System.getenv(); for (String envName : env.keySet()) { System.out.format(“%s=%s%n”, envName, env.get(envName)); } } }  

Security Manager in Java

Security Manager in Java

A security manager is an object that is used to check whether the operation we want to perform is not violating the security policy of the operating system. Sometimes we want to perform any operation and get an exception Exception in thread “AWT-EventQueue-1” java.security.AccessControlException: access denied (java.io.FilePermission characteroutput.txt write) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkWrite(SecurityManager.java:962) at java.io.FileOutputStream.<init>(FileOutputStream.java:169) at java.io.FileOutputStream.<init>(FileOutputStream.java:70) at java.io.FileWriter.<init>(FileWriter.java:46) To Prevent this exception we can use SecurityManager class to check for the permission before performing an operation….

Read More Read More