Q. What do you understand by the term "Portfolio Valuation"?A. A portfolio in financial terms is set of financial assets such as stocks, bonds, mutual funds and cash equivalents.

Valuation is the process of estimating what something is worth. Items that are usually valued are a financial asset or liability. Valuations can be done on assets (for example, investments in marketable securities such as stocks, options, business enterprises, or intangible assets such as patents and trademarks) or on liabilities (e.g., bonds issued by a company).

Q. What do you understand by the terms GAV (Gross Asset Value) and NAV (Net Asset Value)?A. The Gross Asset Value (GAV) is the sum of value of asset (e.g. number of shares owned * share price) an entity (e.g. investor) owns. Net asset value (NAV) is the value of an entity's assets less the value of its liabilities.

Q. What do you understand by the terms debit and credit?A.

Debit = An entry that increases an asset or decreases a liabilityCredit =An entry that increases a liability or decreases an asset

Q. What do you understand by the term accruals? A. The term accrual often used as an abbreviation for the terms accrued expense and accrued revenue, but they have the opposite economic/accounting characteristics.

Accrued revenue: revenue is recognized before cash is received. For example, a service industry enters a contract for 3 month for which the payment of 50,000 will be made at the end of the 3rd month. In the accounting journal entry, the service industry will enter "accrued billings" as 50K debit (i.e. amount owed), and "consulting revenue" as 50K credit. At the end of the 3rd month, "consulting revenue" will be 50K debit, and "accrued billings" will be 50K credit. This is known as the "double entry" accounting.

Accrued expense: expense is recognized before cash is paid out. For example, as a business owner, you accrue GST (i.e. Goods and Services Tax) expenses every month, and you pay it off every 3 months. Another example would be to accrue capital gains tax every month, and then pay it off yearly.

Q. What do you do when you are not sure of a financial term?A. Go to http://www.investopedia.com to get it clarified.

Aug 19, 2013

Visual VM for monitoring Java memory, CPU, threads, etc

VisualVM is a visual tool integrating several command line JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it further enhances the capability of monitoring and performance analysis for the Java SE platform. It is packaged as an exe file. \

Step 1: You can start the visual vm by double clicking on %JAVA_HOME%/bin/jvisualvm.exe from Java 1.6 version on wards.

Step 2: Your local processes will be monitored under the local tab. The Visual vm can also used to open the heap dump files i.e *.hprof files to analyze the menory usages. You can find out the process ids of your local Java applications via

1. Right click on "Remote" and then select "Add Remote Host...".2. Provide the host name like "myapp.com".3. It searches and adds the host.4. Right click on the added host name and then select "Add JMX Connection" and in the "Connection" field type the hostname:JMX port number like myapp.com:8083.5. Double click on this JMX connection to monitor CPU, memory, thread, etc.

Aug 14, 2013

Google Gauva library to work with the collection objects.

The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth. This blog post deals with the Collection utilities using Functional programming. As of Java 7, functional programming in Java can only be approximated through awkward and verbose use of anonymous classes. This is expected to change in Java 8, Please be aware that excessive use of Guava's functional programming idioms can lead to verbose, confusing, unreadable, and inefficient code. Hre is a sample code to demonstrate partitioning, transforming, and filtering.

Aug 12, 2013

BeanIO tutorial

BeanIO is an open source Java framework for marshaling and
marshaling Java beans from a flat file, stream, or simple String object.
It is very powerful with support for XML, CSV, delimited and fixed
length stream formats, Object binding, filed validation, integration
with spring-batch, etc. Here is a basic tutorial to get started.

Step 1: The sample CSV file to convert to an object of type Person.The first record is a header record, and the subsequent ones are detail records.The file is person.csv under src/main/resources/data

H, 2013-03-12
John,Smith, FAMILY
Peter,Smith, FAMILY
Gregory,Smith, FAMILY

Aug 8, 2013

Core Java Best Practices -- Part 1

"Best Practices" is one of the key areas, and often you can impress your interviewers, peers, and code reviewers by applying the best practices to your code. Here is a sample class that can be used as a key to store data in Maps or in Hibernate queries to as where clause parameters. The best practices applied are

Make your objects immutable where possible as immutable classes are inherently thread safe.

Don't reinvent the wheel, and use proven third-party libraries.

Use the Comparable interface if you want to sort your objects naturally.

Step 2 : Configure the Spring container and bootstrap the MyAppListenerListener to the container. You can set up multiple consumers to run concurrently in multiple threads. This basically involves extending the class MyAppJmsTemplateConfig defined in part -2.