Archive

Archive for February, 2010

Where to invest money?

February 26, 2010 Leave a comment

This is very troubling question every one of us have.

As told in ethical books,
Money will be looted by government in the form of taxes. (They ask us to submit tax returns, they put the rules what is tax exempted and what not. Governments never do the same back to citizens. They never tell what are their income and expenses. We can’t control them on where to invest our money.)
Money will be taken by Doctors as high fees for diseases which we never have.
Money will be taken by Lawyers, because we need to fight with unfair law suits.
Invest in Gold, it fluctuates. Invest in Shares, they will fall down.
Invest in Real estate; it will be washed away soon by different ways.

Where there is sweet, there are flies.

1. There is no guarantee for any type of investment in any country.
2. Investment is always in the hands of others and at the mercy of others.

This is the time to practice some philosophy.

1. Don’t be attached too much to Money, Gold and Investment.
2. Look at them as child’s sand castle in sea shore.

How to get max out of Money or Investment?
1. Invest in self, family. (Health, education)
2. Invest your time and money for kids (They are God given gifts).
3. Invest for community, friends and relatives.

Having too much money may cause following problems.
1. No peace. No sleep.
2. Creates tension and stress.
3. Leads to poor health.
4. Problems in relationships.
5. Attracts more law suites, lawyers, criminals and other gangs.
6. May push your doctor to perform more costly procedures.

Happiness and Health comes through
1. Self Contentment
2. Self discipline
3. Good Exercise, Good Food, Good Sleep.

Please remember there is no relationship between Money and Happiness.

For more information read Bible and Bhagvatgeeta.

Matthew 6:24
No one can serve two masters.
Either he will hate the one and love the other,
or he will be devoted to the one and despise the other.
You cannot serve both God and Money

Matthew 19:23-24
Then Jesus said to his disciples,
“I tell you the truth,
it is hard for a rich man to enter the kingdom of heaven.
Again I tell you,
it is easier for a camel to go through the eye of a needle
than for a rich man to enter the kingdom of God.”

Luke 12:15
Jesus sait ‘Watch out!
Be on your guard against all kinds of greed;
a man’s life does not consist in the abundance of his possessions.’

References:
http://globalresearch.ca
http://futureofdollar.com/
http://www.biblegateway.com/

-o-

Commission Vs Robbery

February 26, 2010 Leave a comment

When 100$ item sold, how much sales person should get?

According to sales and marketing books, there is no such limit.
They can take 99$ or 1$ based on situation. They say it is Supply Vs Demand.

I want to tell only one thing.
If you enjoy sex with your legal partner’s consent, it is natural.
If you force her/him to do sex, it is prostitution or rape.

It is applicable to the Sales Person’s Commission.
If he tells his commission to customer and both are happy, it is good deal.
Other wise we can call it as Sales person robbed the customer. Or Customer cheated the sales person.
-o-

JasperReports – conditionalStyle

February 23, 2010 Leave a comment

Problem: How to add colors based on project Status?
Like complete – Green, notcomplete – Red, other – None

Solution: Need to use conditionalStyle

<style name="style_name1" 
	isDefault="false" 
	forecolor="#000000" 
	backcolor="#FFFFFF" 
	fontName="Arial" 
	pdfFontName="Helvetica"
	fontSize="8">
	<conditionalStyle>
		<conditionExpression><![CDATA[new Boolean ($F{projectStatus}.equals("complete"))]]></conditionExpression>
		<style forecolor="#008B45" />
	</conditionalStyle>
	<conditionalStyle>
		<conditionExpression><![CDATA[new Boolean ($F{projectStatus}.equals("notcomplete"))]]></conditionExpression>
		<style forecolor="#FF0000" />
	</conditionalStyle>
	<conditionalStyle>
		<conditionExpression><![CDATA[new Boolean ($F{projectStatus}.equals("other"))]]></conditionExpression>
		<style/>
	</conditionalStyle>
</style>

Reference:

CSS Colors Chart : http://www.somacon.com/p142.php
Style Generator for Jasper: http://www.langtags.com/xmlsnippets/jasperreport/style.html

JasperReports – Style

February 23, 2010 Leave a comment

Problem: How to prepare style for Jasper Report Elements?

Style Generator http://www.langtags.com/xmlsnippets/jasperreport/style.html

JasperReports UI Tools

Jasper Assistant http://www.jasperassistant.com/
iReport http://jasperforge.org/projects/ireport

JasperReports – Image Loading Static Vs Dynamic

February 23, 2010 Leave a comment

Problem: How to load images in JasperReports?

This is the best way to refer static images.

<imageExpression class="java.lang.String"><![CDATA["images/image1.jpg"]]>  

Images must be in the class path. We can pass this value through variable too.

This is the best way to load dynamic images.
Which means that we want to manipulate images based on runtime logic.

<imageExpression class="java.awt.Image"><![CDATA[$F{dynamicImageName}]]>

These images can be picked up from class path or manipulated in memory during run time.
Example: Graphs, Pie Charts …etc

Java – Performance Monitoring

February 19, 2010 Leave a comment

Problem: One method is taking 30 seconds. How can we bring it down to the minimal?

First we need to identify all the code (methods) executed.
Get the time took by each method. So that we can troubleshoot one at a time.

How to do this?

1. Simple solution: Using difference of start time and end time.
We can’t use this always. This is not production quality code and we can’t litter the code with all these methods and calculations.

2. Using API level code
JMON API http://jamonapi.sourceforge.net/

3. Using Monitors. This is best way to test distributed installations.
InfraRED http://infrared.sourceforge.net

- – -

Inheritance abuse in Java

February 18, 2010 Leave a comment

Problem: I am going through the code, Written by somebody else.

public interface FileManipulator
public abstract class FileRepository implements FileManipulator
public class CommonFileRepository extends FileRepository
public class Project1FileRepository extends CommonFileRepository
Some where else they encapsulated Project1FileRepository class.

Given requirement: Program need to read license agreement for project only once. It is not going to change across the project.

Solution:

public class ProjectLicense
{
public static String getLicenseText()
{
// Read the license text from file and return.
// Better to put in static variable and avoid reading again.
}
}

-o-

Interesting facts about Inheritance depth in Java.

http://www.javaspecialists.eu/archive/Issue121.html
http://www.javaspecialists.eu/records/index.jsp

Knoppix on USB Drive

February 13, 2010 Leave a comment

Successfully created USB bootable Knoppix Pen Drive.
So that I can save my personal files and settings.

http://www.pendrivelinux.com/install-knoppix-6-to-a-usb-flash-drive-in-windows/

Categories: Unix Tags:

JasperReports – Line Numbers

February 11, 2010 1 comment

Problem: When using rowNumber, line numbers are starting at 0. How to start them with 1?

Solution:

This starts line number with Zero (0)

<variableExpression><![CDATA[new Integer($V{rowNumber}.intValue()+1)]]></variableExpression>

This starts line number with One (1)

<variableExpression><![CDATA[new Integer($V{REPORT_COUNT}.intValue()+1)]]></variableExpression>

-o-

Mobile Application Testing

February 11, 2010 Leave a comment

Question: How to test applications on mobile phones?

Answer: We have two types of applications.
1. Browser based applications.
2. Simple applications (1. Standalone, 2. Client Server).

Testing approaches:
1. Test on simulators
2. Test on simulators provided by client web sites
3. Test directly on required devices.

There is no difference between regular testing and mobile phone application testing.

Windows iPhone Simulator: http://labs.blackbaud.com/NetCommunity/article?artid=662
Nice online simulator http://testiphone.com/
Very Nice iPhone Simulator: http://www.genuitec.com/products.html
iPhone File Browser: http://code.google.com/p/iphonebrowser/downloads/list
Sample Web based Simulator: http://emulator.mtld.mobi/emulator.php

Theory:
Mobile Web: http://en.wikipedia.org/wiki/Mobile_Web
Mobile Web Best Practices: http://www.w3.org/TR/2010/CR-mwabp-20100211/

Mobile Web Sites
Kayak: http://m.kayak.com/
Orbitz: http://mobile.orbitz.com/
Travelocity iPhone: http://iphone.travelocity.com/
Travelocity BlackBerry: http://mobile.travelocity.com/
Flight Stats: http://www.flightstats.com/go/Mobile/home.do
IHG Mobile Application: http://www.ichotelsgroup.com/wireless/6c/1/en/home.action
Priceline: http://www.priceline.mobi/mobilesite/
List of Mobile Sites: http://wapreview.com/index.php?id=23

Search in Google for mobile simulator / emulators.

-o-

Categories: Software Testing
Follow

Get every new post delivered to your Inbox.