Tuesday, May 31, 2011

converting scientific number to Number - XSLT

To conver BigDecimal number in to the normal number in xslt ,we need to write  a new template .
then call this template in the following way
xsl:call-template name="convertSciToNumString"><xsl:with-param name="inputVal" select="percentAmmo" /></xsl:call-template>Template is
<xsl:template name="convertSciToNumString">
<xsl:param name="inputVal" select="0" />
<xsl:variable name="max-exp">
<xsl:value-of
select="'0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'" />
</xsl:variable>
<xsl:variable name="numInput">
<xsl:value-of select="translate(string($inputVal),'e','E')" />
</xsl:variable>
<!-- ==== Mantisa ==== -->
<xsl:variable name="numMantisa">
<xsl:value-of select="number(substring-before($numInput,'E'))" />
</xsl:variable>
<!-- ==== Exponent ==== -->
<xsl:variable name="numExponent">
<xsl:choose>
<xsl:when test="contains($numInput,'E+')">
<xsl:value-of select="substring-after($numInput,'E+')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring-after($numInput,'E')" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- ==== Coefficient ==== -->
<xsl:variable name="numCoefficient">
<xsl:choose>
<xsl:when test="0 > $numExponent">
<xsl:text>0.</xsl:text>
<xsl:value-of select="substring($max-exp, 1, -number($numExponent)-1)" />
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:when test="$numExponent > 0">
<xsl:text>1</xsl:text>
<xsl:value-of select="substring($max-exp, 1, number($numExponent))" />
</xsl:when>
<xsl:otherwise>
1
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="result">
<xsl:value-of select="number($numCoefficient) * number($numMantisa)" />
</xsl:variable>
<xsl:choose>
<xsl:when test="$result = 'NaN'">
<xsl:value-of select="$numInput" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$result" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<

Cloud Computing -VMForce

Cloud computing refers to the use of networked infrastructure software and the capacity to provide resources to users in an on-demand environment. With cloud computing, information is permanently stored in servers on the Internet and cached temporarily on desktop computers, notebooks, handhelds, or other client devices. In this model, often referred to as “utility computing,” users can access common business applications online from virtually any end user device, on a pay-per-use basis.
                 By design, cloud computing is scalable and elastic, offering IT departments a way to increase capacity or add capabilities on demand, without investing in new infrastructure, training new personnel, or licensing new software.


VMforce 
The first enterprise cloud computing platform for Java developers . This new service will provide enterprise developers with the powerful combination of the Java programming language, the Spring framework, and the Force.com cloud platform. With VMforce, Java developers will be able to build and deploy enterprise apps that are instantly social and available on mobile devices in real time, and that seamlessly leverage Force.com’s cloud database and pre-built platform elements, including reporting and analytics, search, web services API, and application security services. And all of these apps will run on salesforce.com’s trusted global cloud computing infrastructure



Categories of Cloud
When one digs more into the Cloud, there are many types and models of Cloud like Private Cloud, Public Cloud, Hybrid Cloud, Community Cloud, Enterprise Cloud, Infrastructure as a service (IAAS), Platform as a service (PAAS), Software as a Service (SAAS), Business as a service (BAAS), Gaming as a service (GAAS), BPaas, Haas…or easier to say…Anything as a service(XAAS).
Cloud computing is broken down in to few different categories based on the type of service provided
•      SaaS (Software as a Service) is the category of cloud computing in which the main resources available as a service are software applications
•      PaaS (Platform as a Service) is the category/application of cloud computing in which the service providers deliver a computing platform or a solution stack to their subscribers over the internet.




Thursday, July 29, 2010

Corporate Action

                                        When any public company issued some securities and it initiate an even regarding that securities is called Corporate Action. Dividend is one of the types of CA.
The primary reasons for CA
• Return profit to the shareholders
• Influences the share prices
• Corporate restructuring-
Ways of announcing CA
Dividend: Here dividend is the classical example to CA. Company will distribute the profit to the entire share holder. Equity price in the secondary market get adjust because of this CA but as point of the company it is positive sentiment in the secondary market for their equity.
Bonus: company performs well and they want to share the profit to the share holders in the form equity. Equity price will adjust in the market because of this CA but company prospective liquidity will increase in the secondary market. There is an issue here, some share holder are not qualified to take the bonus so they will accrue the loss.
Stock splitting: increase or decrease the number of shares in the market to increase or decrease the price of the stock market
Spinoffs: Are an example of a corporate action where a company breaks itself up in order to focus on its core competencies.                                                                                                                                    
      Following List shows how many ways of announcing CA

  • Cash Dividend,
  • Optional Dividend,
  • Stock Dividend,
  •  Stock Split,
  • Spin Off,
  •  Acquisition,
  •  Rights Offering,
  •  Debt Redemption,
  •  Bonds Exchange,
  •  Bankrupts,
  • Debt Repurchase,
  • Reclassification,
  • Buyback Offer,
  • Pay in Kind.