Tuesday, November 24, 2009

JSF refresh current document

If you ever wanted to refresh the current document to reflect new information...below is the method that you will need...

    public void RefreshCurrentDocument() {
        FacesContext context = FacesContext.getCurrentInstance();
        String currentView = context.getViewRoot().getViewId();
        ViewHandler vh = context.getApplication().getViewHandler();
        UIViewRoot x = vh.createView(context, currentView);
        context.setViewRoot(x);
    }

Good Luck...

Read more...

JSF SelectOneMenu valueChangeListener

Today I used the following code in one of my projects...(the below is just a pseudo code..)



Inside the bean I had:
    public void mymethod(ValueChangeEvent ve)
    {
      ...
      ...
    }


I hoped that changing value on the select menu would fire the method but instead nothing happened...if you are also stuck at this point...change the code as follows:



Notice the onchage attribute that is newly added...this will fire the method...

Hope this helps...

Read more...

Thursday, October 29, 2009

EJB entity relations onetomany

Using @OneToMany and @ManyToOne entity relationship might sound little difficult and confusing in the beginning but actually it is very easy. I recently used it in one of my projects and it worked great.

Here is how the code in your entities should look like...

Assuming table 1 and table 2 have one to many relationship...then...

in the table 1 entity...you have...

...
    @OneToMany(mappedBy="table2mapping")
    private Collection table2list;
   ..associated getter and setter...


in the table2 entity..you have...
@JoinColumn(name = "table2ID", referencedColumnName = "table1ID", insertable=false, updatable=false)
    @ManyToOne
    private table1 table2mapping;

@JoinColumn should be changed depending upon your requirements...
Let me know if you have any questions...

Read more...

Wednesday, October 14, 2009

Finance cheat sheet

Reasons for US firms to invest in foreign countries:
1. Fear of import tariffs (in foreign countries)
2. Lower production costs particularly with regards to labor costs
3. Ease of entry because of advanced American technology
4. Tax advantages
5. Strategic considerations->competition
6. International Diversification. In addition to normal business risks, the multinational corporation is faced with foreign exchange risk and political risk.

Difficulties faced in foreign countries:

Complex laws, customs and economic environment, Rates of inflation, Tax rules, Structure and operation of financial institutions, Financial policies and practices, Work habits and wages of laborers
Approximately 60% to 75% of total sales for multinational companies such as IBM, coca cola come from foreign sales (overseas markets)

NAFTA
1. Stands for-> The North American Free Trade Association
2. The goal of NAFTA was to eliminate barriers to trade and investment between the USA, Canada and Mexico.
3. The implementation of NAFTA on January 1, 1994, brought the immediate elimination of tariffs on more than one half of US imports from Mexico and more than one third of US exports to Mexico.
4. NAFTA also seeks to eliminate non-tariff trade barriers.

Synergy -
1. It is the most important nonfinancial motive for a merger
2. Synergy is said to occur when the whole is greater than the sum of the parts. 3. “2+2=5” means Synergy

Why companies selling…Motives of selling stockholders
1. Desire to receive acquiring firm’s stock which may have greater acceptability in the market.
2. Provides opportunity to diversify their holdings.
3Gain on sale of stock at an attractive price
4. Attractive post-merger management contracts as well as directorships 5. Bias against smaller businesses

Mergers-
1. A Merger is a combination of two or more companies in which the resulting firm maintains the identity of the acquiring company. On the other hand a Consolidation is a two or more companies form an entirely new entity. So do not get confused and think that Merger and Consolidation or same.
2. Motives of Mergers. Financial Motives-risk reduction as a result of portfolio effect, improved financing posture, obtain a tax loss carryforward, higher value of the firm, strengthen cash position and/or improve debt/equity ratio, greater access to financial markets to raise debt and equity capital, lower required rate of return by investors. Non Financial Motives- Expand management and marketing capabilities, acquire new products, synergism.

Mergers – two types –Horizontal Integration => the acquisition of competitors Vertical integration => the acquisition of buyers or sellers of goods and services to the company.

Merger is mentioned in accounting books in two ways: Pooling of interests => In this scenario, the financial statements of the firms are combined and no goodwill is created. Purchase of assets => In this scenario, the offer is in cash, bonds, preferred stock or common stock and goodwill is created.

A warrant is an option to buy a stated number of shares of stock at a specified price over a given period. They are attached to debt securities because of the following reasons:
1. Sweetens or enhances a debt issue.
2. Usually detachable
3.Speculative; value depended on market movement of stock 3. Add-on in a merger or acquisition
4. Equity base expands when warrants are exercised but the underlying debt remains 5. Cannot be forced with a call, but the exercise price is sometimes “stepped-up”

Convertible Bonds-
1. At issue, investors pay a conversion premium, and the price of the convertible exceeds both the pure bond value and the conversion value
2. The convertible bond’s value is limited on the downside by its pure bond value. 3. The value of the convertible bond as a straight bond is called pure bond value 4. If the market price of the common stock exceeds the conversion price, the market value of the bond will rise above its par value to the conversion value or higher. 5. Convertibles are usually subject to a call provision
6. Interest rates on convertibles are less than on nonconvertible straight bonds of the same risk.
7. The pure bond value will fall if interest rates rise.

Conversion Premium
1. It is the market value of convertible bond minus the larger of conversion value or pure bond value.
If Conversion value > pure bond value then

Conversion Premium = Market Value of the convertible bond – Conversion Value
If Pure bond value > Conversion Value then

Conversion Premium = Market Value of the convertible bond – Pure Bond Value

Maturity Stage of a firm:

1.Mature firms follow a relatively high payout policy.
2. Maturity stage is the fourth and final stage in the life cycle growth and dividends process.
3. In the maturity stage the firm maintains a stable sales growth rate and cash dividends tend to be 35%-50% of earnings.
4. Moderate to high cash dividends in this stage.
5. When risk premiums are considered, its returns on assets level out to those of industry and the economy.

Investors choices-

1. Investors in high marginal tax brackets usually prefer companies that reinvest most of their earnings.
2. Investors in lower marginal tax brackets will have a greater preference for dividend, since the tax penalty is less at lower marginal tax rates

Read more...

Eggplant (Vankaya) Tomato Curry

In all vegetables egg plant is one of the tasty and healthy vegetable. In telugu it is called as Vankaya. now iam going to show you an easy and tasty vankaya tomato curry recipe.

ingredients:

egg plants (medium size) - 6 ( cut into length wise)

Tomatoes- 3

Green chillies- 4

Onion-1

red chillie powder-1tablespoon

Ginger garlic paste- 1 teaspoon

jeera -1/2 teaspoon

turmeric- a pinch

salt- as per taste

coconut powder-1 tablespoon

corriander- for garnishing

oil- 2 tablespoons

Recipe:

Put a vessel on the stove on medium heat and pour oil

after oil gets heated add jeera

after it gets splutter add onions and cover lid

after onions becomes transparent add green chillies, ginger garlic paste, turmeric, chilli powder

Mix everything good and add egg plant mix it once

Now add tomatoes mix everything good and cover it with a lid

if it becomes dry add some water

after tomatoes gets mashed up and egg plant get cooked take the lid and add coconut powder and let the gravy becomes thick

finally garnish with corriander leaves and off the stove

Delicious egg plant tomato curry is ready to serve

Tip: Serve it with White rice or chapathi.

Read more...

About This Blog

In this blog you will find simple but great ideas on various topics ranging from food recipes to investment strategies. I hope the ideas presented in this blog will help you all in some way or other. Also included are the recent and hot news around the world...

Go ahead and grasp my ideas...

Disclaimer and Terms of Use

All the ideas and opinions provided herein are intended to share and inform simple and useful information. They come with no warranty of any kind. If you should choose to interpret graspmyideas.blogspot.com information as perfect working ideas, or advice or if you want to completely rely on these ideas, you do so at your own risk.

This site is offered as is and without warranties of any kind. We are not responsible for timeliness, accuracy, unavailability or interruptions in availability, viruses or other defects in the site or its contents. In no event shall graspmyideas.blogspot.com site or its authors are responsible for any damages to users or their computer systems.


Your Ad Here

  © Blogger template AutumnFall by Ourblogtemplates.com 2008

Back to TOP