<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-32004202</id><updated>2012-02-16T14:58:09.834-08:00</updated><category term='pricing'/><category term='CDT'/><category term='derivatives'/><category term='finance'/><category term='java'/><category term='Eclipse plug-in development'/><category term='books'/><category term='source code'/><category term='Hover Help Plug-in'/><category term='algorithms'/><category term='review'/><category term='java/j2ee'/><category term='Symbian'/><category term='options'/><category term='Carbide c++'/><category term='announcements'/><title type='text'>Deniz's Corner</title><subtitle type='html'>“Life is like riding a bicycle. To keep your balance you must keep moving” A. Einstein</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-32004202.post-8176504673554552946</id><published>2012-01-01T08:23:00.000-08:00</published><updated>2012-01-01T08:41:21.513-08:00</updated><title type='text'>Affordable House prices in London</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;What is the biggest issue in London? I think, it is affordable housing issue for working class people.  To get a secure, habitable, accessible (close to transports) house in London is a big issue. Although, Compare to many cities in the world, of course London is maybe the more secure and accessible (transport infra-structure is good) city, but perception among Londoner is not that much optimistic, as far as I see, from my experiences. In this text, i will explore the state of housing in London in terms of affordability for local, common people and try to answer question, if house prices in London will decrease or increase in 2012, given supply and demand parameters. And my conclusion is, it will decrease, but it won’t crash, yet.  I will try to establish it in terms of demand/supply factors.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;Foremost, I am not expert on real-estate properties. But last one year, I am doing my own research to find a suitable house in London, therefore, this text will be based on my own research and personal experiences.  So, don’t forget to do your own research.  I don’t work for any real estate related company or any whatsoever relation. I know, statistics, is white lies, but in order to justify my conclusion, I will use some statistics. Most of statistics in this text will be based on following publication from Local London Authority and Land Registry: &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;http://www.london.gov.uk/sites/default/files/Housing%20in%20London%20Dec11.pdf&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;http://www.landreg.gov.uk/upload/documents/HPI_Report_Nov_11_ws13pm4.pdf&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;I think housing issues is a timer bomb, waiting to explode. And at the moment,  I cannot see a  sound policy to address it, neither from local and governmental authorities agencies. They hope the issue resolves itself. Would it be resolved itself for common people in a free market capitalist economy, where rich foreigner can buy properties or it is open to migration?&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;In Maslow's hierarchy of needs, sheltering is at the bottom, among side of breathing, food, water, sleep, sex, excretion. People need a shelter, a home. That is very basic. We need a safe place to nurture. We either need to rent or buy house to live in. In some worst cases, some of us are forced to streets or squatting. Actually, because of current economic crisis, homeless people in London streets increase (around 4000 people in London streets, increased almost 33 % since economic crisis started in 2008). &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;According to statistics, in 2011, in London, 53 % of people own their house, from high of 57 % in 2001. Around 25% people in private or social rental and private rental is increasing.   &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;So let’s we assume that you are one of these lucky person in London who has a job and afford to rent a place at least.  Actually, most of these people prefer to buy a house rather than renting.  Statistically, 85% of  Londoners would prefer to buy a house. So, these people somehow have to save money to buy a house, if they are in rent.   &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt; Average house price in London in July 2011 was £347,000 which includes very expensive houses in exclusive places of London. In that text, since I am considering affordable house for Londoners, I assume average house price in London £250,000, which is actually of mean of house prices and also what I have observed since last year. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;For a first time buyer, you need to provide at least %20 deposit for mortgage which is be around £50K. In addition, you need at least £5K for other services (mortgage, legal, surveyor, and I am not including  %3 stamp duty tax for houses less than £250K). For someone, who would be saving £500 per month, it would take at least 10 years to make a 20% deposit which leads people to not save but spend, as it seems very long term investment. Given that people in UK are bombard to spend by capitalist system, rather than save, most people do not save, but enjoy today, rather than thinking tomorrow.  &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;So, I think, most of first time buyer cannot afford to buy house because of restriction on mortgage. Therefore, in terms of first time buyer, demand is low.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;There is also another type of buyers who prefers to work in London, but who do not prefer to live in London.  They prefer to commute every day 2-3 hours than living in London. For example, some of my colleagues and friends, commutes from Brighton and Oxford (2-3 hours journey everyday), rather than to live in London.  So, another low demand factor.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;But, we have also foreigner factors in London in terms of demand. This factor, foreigner investing in London, buying houses in London, is one of the biggest factors in increase house prices in the last decade. Rich foreigner sees London as a safe place to invest. They think, they will make good profit. And actually they do. In exclusive neighbourhood in zone 1, house prices has increased almost 9% last year, but overall increase all over London was %1. So, simply, some rich people will invest in zone 1, but I wonder if they will invest in houses, in zone 2 or zone 3? For example Stratford which is going to host 2012 Olympics. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;I doubt it. I don’t think, any rich foreigner will invest it in zones apart from Zone 1 or Zone 2. I was walking in Stratford last week, I noticed many empty flats. It seems not much demand for these new small flats which is built Olympics pipe dreams. For example, house prices in Newham (which holds Olympics and zone 3) has reduced 0.3% in the last year.  Besides that, I don’t think, rich foreigner will see London as safe place while EU is in credit crisis. Remember the attitude of Chinese government regarding to buying EU zone debts? They refused it. They are not investing in EU as they do not have faith. Sure, UK and EU is not exactly same, but they have strong trading ties. I think, these rich people would invest more in emerging markets, such as Brazil, Turkey and Poland or Zone 1 in London.   So rich foreigner investment won’t effect houses prices for common people who  cannot afford to buy a house in Zone 1 or 2, they  are already priced out in these zones.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;Now let’s have a look at possible seller. Let starts with local Londoners, who bought house very long time ago and would like to sell it and leave the city. Actually, in 2011, net migration is negative.  For example, between mid 2009 and 2010 11,200 more people moved out London than moving in.  And I think, in 2011, that number has increased due to economic crisis.  So that would increase housing supply.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;Other type of people who would like to sell house are those who bought big houses before boom, and would like to sell now to make a profit and get a smaller or bigger places.  That’s very common. Lately, a friend of mine sold his house to get a bigger place to settle down and have a family.  And I read from many websites, people sells big houses to make profit and buy smaller and more affordable inner central places and invest house abroad. Since, these buys and sells kinda offset each other, in terms of demand and supply; they are negligible, if not increase the supply. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;There is an emotional factor during selling and buying house prices. Many house owners feel that their house still worth as much as peak of 2007. For example, one of the house owners got very emotional once I did not offer as much as she thought so. After my discussion and email about my reasoning  why it does not worth, she sliced her prices £15K (5% lesser), but it was still so high for that house.  Statistically, in UK, average asking price of house is  £236,597, but selling price is £168,205 according to land registry. That means almost 30% higher asking price and a very good negotiation (middle-eastern or Asian way) has to be done, as house owner expect very high. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;Let’s have a look at also housing supply in London. In last 3-4 years, in average, around 25000 new house is delivered. A total of 40,870 affordable homes were delivered in the three years 2008/09 to 2010/11. As future,   there are 172,000 homes in London with outstanding planning permission, of which just over a third are under construction.  Most of these houses (55000) will be built in Greenwich, Tower Hamlets and Newham. Camden and Richmond and Kingston Upon Thames  will have smallest new home, 550 and 1,200 home respectively . It is estimated that London population have grown by 71,600 between 2009 and 2010. That growth is attributed to mostly natural changes (birth, dead) .  Therefore, delivered new houses (25000) are a bit short of demand due to population growth (71000) in long term, but for short term demand-supply is equal, if supply is not less.   &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;As I mentioned above, most of the new house (almost third) will be built in Greenwich, Tower Hamlets and Newham area of London.  These are the most deprived places of London.  With Olympics 2012 and  Royal Docks Enterprise Zone, Cross Rail and several private initiatives(for example Westfield shopping centre in Stratford),  east London is getting attention.  But Londoners emotional attitude towards these areas are very distant. West and North areas are still very popular. In that sense, to get people attention to the east, house prices must be lower; this is already lower compare to North and West London, in fact.  &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;Although house prices in London have increased 1%, when you consider inflation, house prices are actually is going down. Royal Institution of Chartered Surveyors reckons that house prices will fail %3 in 2012.  Given that house prices is still 40% higher than 2006, it will go further, I think. But the question is how much and longer? I don’t think, house prices would go so much down, as that would be disaster for so many people for whom bought house in peak times. According to Council of Mortgage Lenders, around 13% mortgages approved after 2005 is in negative equity, while house prices are down around 10% meanwhile.  Therefore, government will take some action to make sure, house prices to stabilise otherwise they will have an issue in election.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;So, government has a dilemma.  House prices cannot go much down, in that case it will scare foreign investor and also many public will be in negative equity. Therefore, I reckon, government will use inflation to wipe out its debt and public dept. With higher inflation, house prices will decrease in real terms, like in 2011. Government will also control supply chain to make sure there is not much new houses.  &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;span&gt;Overall, I think, house prices will decrease in 2012, especially when you consider inflation.  The factors increase house prices  are: Low level of new houses compare to population growth, high renting prices and basic needs (people need a shelter).  On other hand, I can count many factors which will decrease house prices:  Already overprices, low level  of mortgage approval for first time buyer, reluctant foreign investor, poor housing and habitation. But, I think, house prices won’t crash due to historical low level interest rate. Once interest rate starts soaring and people could not pay their mortgage, and repossessions start, supply will be higher and then we may see property crash.  But policy makers won’t sit idle, they will come up with something, as public are very emotional with their house and many people see them also as a retirement investment.  &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-8176504673554552946?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/8176504673554552946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=8176504673554552946' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8176504673554552946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8176504673554552946'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2012/01/housing-prices-in-london.html' title='Affordable House prices in London'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-2179890448157712308</id><published>2011-12-26T09:12:00.000-08:00</published><updated>2011-12-26T10:14:07.176-08:00</updated><title type='text'>Types of Market Orders</title><content type='html'>&lt;div style="text-align: justify;"&gt;Type of order is very important during execution of  a trade, as it would lead to unsolicited higher trading cost, if wrong type of order is used. In this text, I will shortly talk about types of market orders.&lt;/div&gt;&lt;span&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;But foremost, let's shed some light on what is order and it is common properties. An order is an instruction to the market how to execute an order with some criteria. All orders have instrument id, size and if it is a sell or buy. In addition to that, orders have some attached conditions such as limit price, expiry date, market type, market trend and quantity.  Lets dive into these types now.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1- Price Related Orders&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;These orders are executed once some price related criteria are met in order book.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1.1 Market Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;This is most straightforward order type in which order is executed with available market bid and ask prices. An buy order will be matched with lowest ask price and a sell order will be matched with a highest bid price.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Inpatient traders may give this order to fill their order immediately with some degree of price uncertainty. While it is guaranteed to be executed, the price may move. This order type would have market impact, if big quantity is asked/offered which leads to huge unwanted losses. That order type provides demand and supply liquity to market. Because of spread between bid and ask prices, sequential sell/buy trades cause an immediate loss (ask-bid price). In market orders, sometimes, bid/ask price is improved, if market maker wants to have a priority in order book. Market maker has to improve the ask/bid price if a retail customer is in the order book due to exchange rules.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1.2 Limit Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;If a trader wants to limit the risk of market move, limit orders can be used. Trader specify a maximum/minimum prices to buy or sell, respectively.In other words, it is the highest buy price and lowest sell price for the trader would be happy to accept. Limit prices are used to minimize cost of market move by making sure execution price is always higher (sell)  or lower (buy) than a predefined price.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;A limit order can be very aggressive or passive. If limit order is around the market price (marketable limit order), it will be filled quicker than those  far away from the bid/ask prices (behind the market). If a limit order is equal the bid/ask prices, then it will be at the market limit order. &lt;/div&gt;&lt;span&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: justify;"&gt;Standing limit orders provides option for other traders to trade for free. For example, a sell limit order is an call option for another trader. Similarly, a buy limit order is a put option for other trader. Deepness and structure (symmetric or aysmetric) of a order book in terms of limit orders can be used in trading strategies.&lt;/div&gt;&lt;span&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;There are two risk in limit order: Execution uncertainty and ex-post regret. If limit order is placed far away from a bid/ask prices, it may not be executed at all. Second risk is that a limit order may be triggered and filled in a short period of time and then move in the same direction. In other words, trader estimates wrong exit point and regret to exit trade earlier.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1.3 Stop Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;Let say, you want an order get executed once the bid/ask price reach to a a pre-defined price. This order mostly used to stop losses when price moves against their position. For example, a trader may give a sell stop order if the price of a stock drops to a pre-defined lower price (60p) than current price (65p).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Although, stop and limit orders looks like similar, there are different. In limit order, execution price wont be be lower(sell) or higher (buy) than predefined limit. In stop order, once order is triggered, the order is filled with market price. It can be higher or lower than pre-defined stop price.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Stop order is generally used with other order types. For example, with a market order, a trader may put a stop order above of a resistance to buy a stock or below of support point to short a stock.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Stops orders may accelerate price changes. Especially in illiquid markets, if there are lots of asymmetric stop orders, market makers or well informed traders would take advantage of it to trigger sudden huge sell or buy movement to obtain much unavailable stocks (by lowering price) or dumping stocks (by increasing prices). That practice is called tree shaking, and it is applied by market makers time to time to purchase unavailable stocks from public by reducing price of a stock suddenly and triggering stop orders (shake the tree) and then picking up the stocks (apples).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1.4 Limit Stop Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;If a stop order is used with a limit order, it is called stop-limit order. Trader has to provide two prices in order: Stop price and limit price. Stop price is used for activation and limit price is used to limit cost of market limit. For example, a trader predicts a bull market once a resistance point is passed. But he also wants to limit his exposure to market move. For this one, he would place a stop limit order in which resistance point (maybe slightly higher) as stop price and limit price as 5% of stop price.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;1.5 Market-If-Touched Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;This order type is similar to limit orders with one difference. Once the specified price is touched, it is executed with market price. In that sense, it is similar to stop order but, it is in the opposite direction of current market price. That type of orders are not common, traders mostly use limit orders.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;2- Trend Related orders&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;This type of orders utilise the trend or movement of price. For example, tick sensitive orders uses previous tick price. a previous price is higher than current price then it is a &lt;i&gt;downtick &lt;/i&gt;or vice versa &lt;i&gt;uptick&lt;/i&gt;. If price do not change between previous and last trade, it is a &lt;i&gt;zerotick&lt;/i&gt;. So, an order can be structured in a way that, it is executed only in &lt;i&gt;uptick&lt;/i&gt;(or &lt;i&gt;downtick&lt;/i&gt;).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Trend related orders are generally used to neutralize market impact. For example, a sell uptick order makes sure, for each sell, another price moves the price up. It wont execute order if price goes up.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Actually, trend  related orders are dynamic limit orders. For example, in buy downtick orders, limit price is dynamically adjusted to below difference last price. That type of orders are more effective when the tick size is large. That order type lost its popularity after decimalization of the US stock market in 2000. Tick size was one-sixteenth (6.25cents) before 2000, but it is decreased to 1 cents.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;3- Expiry Related Orders&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;In addition to price related constraints, orders generally includes expiry related conditions, especially for limit and stop orders. These trades generally waits in order book to be matched.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;i&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;Day orders&lt;/i&gt; are valid for the trading day and it is the most common expiry condition. When market is closed, the order expires.&lt;/div&gt;&lt;/i&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;i style="font-style: italic; "&gt;Good-til-cancel (GTC)&lt;/i&gt; orders are stays in order book until it is cancelled manually by trader.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;i style="font-style: italic; "&gt;Good-until-orders&lt;/i&gt; stays in order book until a predefined date or period. Most common periods are week (Good-this-week) and month (Good-this-month).&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;i style="font-style: italic; "&gt;Fill-or-kill orders&lt;/i&gt; are valid only when they are presented to the market. Unfilled part of the order is cancelled immediately.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;i style="font-style: italic; "&gt;Good-after-order&lt;/i&gt; get activated after a specified time in the order book.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;i style="font-style: italic; "&gt;Market-on-open orders&lt;/i&gt; are filled only in the opening session of a market which uses market open price.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify; "&gt;&lt;i style="font-style: italic; "&gt;Market-on-close orders&lt;/i&gt; are filled only in the closing session of a market which takes market closing price as basis.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;&lt;span&gt;4- Others&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;4.1 Market-not-Held Orders &lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;Sometimes, a trader would leave trading strategy to the broker or floor specialist, as the broker or specialist is more experienced than trader. Broker comes up with execution plan to minimise trading cost for its client. In this order type, broker does not have legal responsibility to fill order in best prices, unlike market order.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;4.2 All-or-None&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;In this type order, either whole size of requested trade is executed at once or not. A very large trade with a all-or-none order is generally negotiated between traders. As alternative to that, an order can specify minimum accepted quantity.&lt;/div&gt;  &lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;4.3 Spread Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;When two different but correlated instrument is traded (sell and buy), a spread order can be used. Since, these instruments are related, there is a spread between them. An order can be constructed buy and sell instruments while the spread between these two instrument do not exceeds (or exceeds) a pre-defined limit.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;4.4 Iceberg Orders&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;div style="text-align: justify;"&gt;A very large order would have very adverse affect on market price if its size displayed on the market. Other traders would take advantage of this condition. To prevent it, display quantity of a large order can be limited to a smaller size, until it is fully filled.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span  &gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;- Standard order types are used for trading. For example, in FIX protocol, tag 40 (OrdType), following values are expected for an order.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;1= Market&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;2=Limit&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;3=Stop&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;4=Stop limit&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;J=Market If Touched (MIT)&lt;/div&gt;&lt;div&gt;- Market orders executed immediately with current market prices and would cause market impact in large order.&lt;/div&gt;&lt;div&gt;- Limit orders supply liquidity by providing free trading option to other traders.&lt;/div&gt;&lt;div&gt;- While limit and market orders do not stabilize prices, stop orders can be used to destabilize the price. &lt;/div&gt;&lt;div&gt;- Various electronic automated trading strategies (for example iceberg, closing, open, spread) utilise these order types to minimize trading costs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below table summarizes types of market order.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;  mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt"&gt;  &lt;tbody&gt;&lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" align="center" style="margin-bottom: 0.0001pt; text-align: center; "&gt;&lt;b&gt;Order   Type&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border:solid windowtext 1.0pt;   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:   solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" align="center" style="margin-bottom: 0.0001pt; text-align: center; "&gt;&lt;b&gt;Usage&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border:solid windowtext 1.0pt;   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:   solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" align="center" style="margin-bottom: 0.0001pt; text-align: center; "&gt;&lt;b&gt;Effect   on Liquidity&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border:solid windowtext 1.0pt;   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:   solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" align="center" style="margin-bottom: 0.0001pt; text-align: center; "&gt;&lt;b&gt;Price   Contingencies&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border:solid windowtext 1.0pt;   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:   solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" align="center" style="margin-bottom: 0.0001pt; text-align: center; "&gt;&lt;b&gt;Advantages&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border:solid windowtext 1.0pt;   border-left:none;mso-border-left-alt:solid windowtext .5pt;mso-border-alt:   solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" align="center" style="margin-bottom: 0.0001pt; text-align: center; "&gt;&lt;b&gt;Disadvantages&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Market &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Common&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Demand immediate liquidity&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;None&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Immediate execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Uncertain price impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Standing Limit &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Common&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Supply liquidity&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Hard limit on price, a better or on limit price execution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Limited price with on market impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Uncertain execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Marketable Limit &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Common&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Supply immediate liquidity&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Hard limit on price, a better or on limit price execution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Limited price impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Limited price impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Trend Related&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Occasional&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Supply liquidity&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Must sell on uptrend or buy on downtrend&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;No price impact, dynamic with market&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Uncertain price impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Stop Market&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Occasional&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Demands liquidity when it is least available&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Triggered when price touches or moves through the stop price;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Used to stop losses&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Huge price impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Stop limit&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Rare&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Triggered when liquidity is least available;  offers liquidity on the side not needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Triggered when price touches or moves through the stop price and   trade must be at or better than limit price. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Limit price impact upon a trigger&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Uncertain execution&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr&gt;   &lt;td width="95" valign="top" style="width:71.25pt;border:solid windowtext 1.0pt;   border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;   padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Market-if-Touched&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="95" valign="top" style="width:71.5pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Very Rare&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="116" valign="top" style="width:87.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Demand immediate liquidity and supplies  resiliency&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="121" valign="top" style="width:90.85pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Triggered when price touches or moves through the touch price&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="86" valign="top" style="width:64.3pt;border-top:none;border-left:none;   border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Fast execution, upon a trigger&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td width="103" valign="top" style="width:77.1pt;border-top:none;border-left:   none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;   mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;   mso-border-alt:solid windowtext .5pt;padding:0cm 5.4pt 0cm 5.4pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;Uncertain price impact&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-2179890448157712308?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/2179890448157712308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=2179890448157712308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2179890448157712308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2179890448157712308'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2011/12/type-of-market-orders.html' title='Types of Market Orders'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-6630026975701253564</id><published>2011-12-22T15:19:00.000-08:00</published><updated>2011-12-24T13:00:14.381-08:00</updated><title type='text'>Reminiscences of a Stock Operator  -- Quotes</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/-HH-1BGvUs-M/TvYzfUqy7EI/AAAAAAAAAGc/ZDc-DQaeY3c/s1600/ephesusInscriptions.jpg"&gt;&lt;span&gt;&lt;img style="text-align: justify;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 243px; " src="http://4.bp.blogspot.com/-HH-1BGvUs-M/TvYzfUqy7EI/AAAAAAAAAGc/ZDc-DQaeY3c/s400/ephesusInscriptions.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5689791792446368834" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;When i first read the meaning of  proclamation carved in a stone in Ephasus from Emperor Valentinian, Valens, and Gratian, somehow, it shocked me.  That short text was indicating to me that, not so many things have been changed  in terms of politics, power, taxing, corruption since it was carved, in  4th century (text can be found &lt;a href="http://briankohl.com/photogallery/turkey-aegean_coast1-ephesus-written_extra.html"&gt;here&lt;/a&gt;). Some texts, books are timeless. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;a href="http://en.wikipedia.org/wiki/Reminiscences_of_a_Stock_Operator"&gt;Reminiscences of a Stock Operator&lt;/a&gt; is one of them, I think. I have come cross that book several times in many reading list, but somehow, I skipped it. Until last month. Finally i decided to give a go to that book. And i regret that i have not read it before. I am amazed with its style and frankness and still contemporary, relevant content, after almost a century. It is a book, it deserves to be read more than once and if not, some parts must be noted down to go through time to time. Therefore, i extracted some quote from the book, for future references. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;1&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;There is nothing new in Wall Street. There can't be because speculation is as old as the hills. Whatever happens in the stock market today has happened before and will happen again.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;There is  always a reason for fluctuations, but the tape does not concern  itself with the why and wherefore. It doesn't go into  explanations. I didn't ask the tape why when I was fourteen, and I don't ask it today, at forty. The reason for what a certain stock does today may not be known for two or three days,or  weeks, or months. But what the dickens does that matter? Your  business with the tape is now -- not tomorrow. The reason can wait. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;2&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt; I always  made money when I was sure I was right before I began. What beat  me was not having brains enough to stick to my own game -- that  is, to play the market only when I was satisfied that precedents  favored my play. There is a time for all things, but I didn't  know it. And that is precisely what beats so many men in Wall Street who are very far from being in the main sucker class. There is the plain fool, who does the wrong thing at all times everywhere, but there is the Wall Street fool, who thinks he must trade all the time. No man can always have adequate reasons for buying or selling stocks daily or sufficient knowledge to make his. play an intelligent play. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt; The desire for constant action irrespective  of underlying conditions is responsible for many losses in Wall Street even among the professionals, who feel that they must take home some money every day, as though they were working for regular wages. I was only a kid, remember. I did not know then what I learned later, what made me fifteen years later, wait two long weeks and see a stock on which I was very bullish go up thirty points before I felt that it was safe to buy it. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;A stock operator has to fight a lot of expensive enemies within himself.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I don't know whether I make myself plain, but I never lose my temper over the stock market. I never  argue with the tape. Getting sore at the market doesn't get you anywhere.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;3&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It takes a man a long time to learn all the lessons of all his mistakes. They say there are two sides to everything. But there is only one side to the stock market; and it is not the bull side or the bear side, but the right side.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I have been flat broke several times, but my loss has never been a total loss. Otherwise, I wouldn't be here now. I always knew I would have another chance and that I would not make the same mistake a second time. I believed in myself.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Speculation is a hard and trying business, and a speculator must be on the job all the time or he'll soon have no job to be on.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I owe my early success as a trader to them and not to brains or knowledge, because my mind was untrained and my ignorance was colossal. The game taught me the game. And it didn't spare the rod while teaching.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;If somebody had told me my method would not work I nevertheless would have tried it out to make sure for myself, for when I am wrong only one thing convinces me of it, and that is, to lose money. And I am only right when I make money. That is speculating.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Ignorance at twenty-two isn't a structural defect.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;If the unusual never happened there would be no difference in people and then there wouldn't be any fun in life. The game would become merely a matter of addition and subtraction. It would make of us a race of bookkeepers with plodding minds. It's the guessing that develops a man's brainpower. Just consider what you have to do to guess right.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;4&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Brokers always had the hope of getting away from me what I had taken from them. They regarded my winnings as temporary loans.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;5&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The first change I made in my play was in the matter of time. I couldn't wait for the sure thing to come along and then take a point or two out of it as I could in the bucket shops. I had to start much earlier if I wanted to catch the move in Fullerton's office. In other words, I had to study what was going to happen to anticipate stock movements. That sounds asininely commonplace, but you know what I mean. It was the change in my own attitude toward the game that was of supreme importance to me. It taught me, little by little, the essential difference between betting on fluctuations and anticipating inevitable advances and declines, between gambling and speculating. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I discovered that although I often was 100 per cent right on the market that is, in my diagnosis of conditions and general trend -- I was not making as much money as my market "rightness" entitled me to. Why wasn't I? There was as much to learn from partial victory as from defeat. &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;They say you never grow poor taking profits. No, you don't. But neither do you grow rich taking a four-point profit in a bull market.  Where I should have made twenty thousand dollars I made two thousand. That was what my conservatism did for me.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Suckers differ among themselves according to the degree of experience.  The tyro knows nothing, and everybody, including himself, knows it. But the next, or second, grade thinks he knows a great deal and makes others feel that way too. He is the experienced sucker, who has studied not the market itself but a few remarks about the market made by a still higher grade of suckers. The second-grade sucker knows how to keep from losing his money in some of the ways that get the raw beginner. It is this semisucker rather than the 100 per cent article who is the real all-the-year-round support of the commission houses. He lasts about three and a half years on an average, as compared with a single season of from three to thirty weeks, which is the usual Wall Street life of a first offender. It is naturally the semisucker who is always quoting the famous trading aphorisms and the various rules of the game. He knows all the don'ts that ever fell from the oracular lips of the old stagers excepting the principal one, which is: Don't be a sucker! &lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The customer would finish the tale of his perplexity and then ask: "What do you think I ought to do?"  Old Turkey would cock his head to one side, contemplate his fellow customer with a fatherly smile, and finally he would say very impressively, "You know, it's a bull market!" Time and again I heard him say, "Well, this is a bull market, you know!" as though he were giving to you a priceless talisman wrapped up in a million-dollar accident-insurance policy. And of course I did not get his meaning.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;What old Mr. Partridge said did not mean much to me until I began to think about my own numerous failures to make as much money as I ought to when I was so right on the general market. The more I studied the more I realized how wise that old chap was. He had evidently suffered from the same defect in his young days and knew his own human weaknesses. He would not lay himself open to a temptation that experience had taught him was hard to resist and had always proved expensive to him, as it was to me.  I think it was a long step forward in my trading education when I realized at last that when old Mr. Partridge kept on telling the other customers, "Well, you know this is a bull market!" he really meant to tell them that the big money was not in the individual fluctuations but in the main movements that is, not in reading the tape but in sizing up the entire market and its trend.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;After spending many years in Wall Street and after making and losing millions of dollars I want to tell you this: It never was my thinking that made the big money for me. It always was my sitting. Got that? My sitting tight! It is no trick at all to be right on the market. You always find lots of early bulls in bull markets and early bears in bear markets. I've known many men who were right at exactly the right time, and began buying or selling stocks when prices were at the very level, which should show the greatest profit. And their experience invariably matched mine -- that is, they made no real money out of it. Men who can both be right and sit tight are uncommon. I found it one of the hardest things to learn. But it is only after a stock operator has firmly grasped this that he can make big money. It is literally true that millions come easier to a trader after he knows how to trade than hundreds did in the days of his ignorance.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;A man may see straight and clearly and yet become impatient or doubtful when the market takes its time about doing as he figured it must do. That is why so many men in Wall Street, who are not at all in the sucker class, not even in the third grade, nevertheless lose money. The market does not beat them. They beat themselves, because though they have brains they cannot sit tight.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Disregarding the big swing and trying to jump in and out was fatal to me. Nobody can catch all the fluctuations. In a bull market your game is to buy and hold until you believe that the bull market is near its end. To do this you must study general conditions and not tips or special factors affecting individual stocks.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;One of the most helpful things that anybody can learn is to give up trying to catch the last eighth or the first. These two are the most expensive eighths in the world. They have cost stock traders, in the aggregate, enough millions of dollars to build a concrete highway across the continent.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Without faith in his own judgment no man can go very far in this game. That is about all I have learned to study general conditions, to take a position and stick to it. I can wait without a twinge of impatience. I can see a setback without being shaken, knowing that it is only temporary.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;If I learned all this so slowly it was because I learned by my mistakes, and some time always elapses between making a mistake and realizing it, and more time between realizing it and exactly determining it.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;6&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It isn't a hunch but the subconscious mind, which is the creative mind, at work. That is the mind which makes artists do things without their knowing how they came to do them. Perhaps with me it was the cumulative effect of a lot of little things individually insignificant but collectively powerful.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I began to think of basic conditions instead of individual stocks. I promoted myself to a higher grade in the hard school of speculation. It was a long and difficult step to take.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;7&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;People don't seem to grasp easily the fundamentals of stock trading. I have often said that to buy on a rising market is the most comfortable way of buying stocks. Now, the point is not so much to buy as cheap as possible or go short at top prices, but to buy or sell at the right time. When I am bearish and I sell a stock, each sale must be at a lower level than the previous sale. When I am buying, the reverse is true. I must buy on a rising scale. I don't buy long stock on a scale down, I buy on a scale up.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Remember that stocks are never too high for you to begin buying or too low to begin selling. But after the initial transaction, don't make a second unless the first shows you a profit. Wait and watch.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;8&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I was utterly free from speculative prejudices. The bear side doesn't appeal to me any more than the bull side, or vice versa. My one steadfast prejudice is against being wrong.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;That is why I repeat that I never argue with the tape. To be angry at the market because it unexpectedly or even illogically goes against you is like getting mad at your lungs because you have pneumonia.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;9&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I have always played a lone hand. I began that way in the bucket shops and have kept it up. It is the way my mind works. I have to do my own seeing and my own thinking. But I can tell you after the market began to go my way I felt for the first time in my life that I had allies -- the strongest and truest in the world: underlying conditions. They were helping me with all their might.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It was an old trading theory of mine that when a stock crosses 100 or 200 or 300 for the first time the price does not stop at the even figure but goes a good deal higher, so that if you buy it as soon as it crosses the line it is almost certain to show you a profit. Timid people don't like to buy a stock at a new high record. But I had the history of such movements to guide me.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The only thing to do when a man is wrong is to be right by ceasing to be wrong.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;My greatest discovery was that a man must study general conditions, to size them so as to be able to anticipate probabilities. In short, I had learned that I had to work for my money. I was no longer betting blindly or concerned with mastering the technic of the game, but with earning my successes by hard study and clear thinking.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;My biggest winnings were not in dollars but in the intangibles: I had been right, I had looked ahead and followed a clear-cut plan. I had learned what a man must do in order to make big money; I was permanently out of the gambler class; I had at last learned to trade intelligently in a big way. It was a day of days for me.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;10&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;If a man is both wise and lucky, he will not make the same mistake twice. But he will make any one of the ten thousand brothers or cousins of the original. The Mistake family is so large that there is always one of them around when you want to see what you can do in the fool-play line.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Losing money is the least of my trcubles. A loss never bothers me after I take it. I forget it overnight. But being wrong -- not taking the loss that is what does the damage to the pocketbook and to the soul.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Money creates needs or encourages their multiplication. I mean that after a man makes money in the stock market he very quickly loses the habit of not spending. But after he loses his money it takes him a long time to lose the habit of spending.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I would rather play commodities than stocks. There is no question about their greater legitimacy, as it were. It partakes more of the nature of a commercial venture than trading in stocks does. A man can approach it as he might any mercantile problem. It may be possible to use fictitious arguments for or against a certain trend in a commodity market; but success will be only temporary, for in the end the facts are bound to prevail, so that a trader gets dividends on study and observation, as he does in a regular business. He can watch and weigh conditions and he knows as much about it as anyone else. He need not guard against inside cliques. Dividends are not unexpectedly passed or increased overnight in the cotton market or in wheat or corn. In the long run commodity prices are governed but by one law -- the economic law of demand and supply. The business of the trader in commodities is simply to get facts about the demand and the supply, present and prospective. He does not indulge in guesses about a dozen things as he does in stocks. It always appealed to me trading in commodities.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Prices, like everything else, move along the line of least resistance. They will do whatever comes easiest, therefore they will go up if there is less resistance to an advance than to a decline; and vice versa.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The trend has been established before the news is published, and in bull markets bear items are ignored and bull news exaggerated, and vice versa.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;A man has to guard against many things, and most of all against himself -- that is, against human nature. That is the reason why I say that the man who is right always has two forces working in his favor  basic conditions and the men who are wrong.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;In a narrow market, when prices are not getting anywhere to speak of but move within a narrow range, there is no sense in trying to anticipate what the next big movement is going to be up or down. The thing to do is to watch the market, read the tape to determine the limits of the get-nowhere prices, and make up your mind that you will not take an interest until the price breaks through the limit in either direction. A speculator must concern himself with making money out of the market and not with insisting that the tape must agree with him. Never argue with it or ask it for reasons or explanations. Stock-market post-mortems don't pay dividends.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It is surprising how many experienced traders there are who look incredulous when I tell them that when I buy stocks for a rise I like to pay top prices and when I sell I must sell low or not at all. It would not be so difficult to make money if a trader always stuck to his speculative guns -- that is, waited for the line of least resistance to define itself and began buying only when the tape said up or selling only when it said down. He should accumulate his line on the way up. Let him buy one-fifth of his full line. If that does not show him a profit he must not increase his holdings because he has obviously begun wrong; he is wrong temporarily and there is no profit in being wrong at any time. The same tape that said up did not necessarily lie merely because it is now saying NOT YET.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It is simple arithmetic to prove that it is a wise thing to have the big bet down only when you win, and when you lose to lose only a small exploratory bet, as it were. If a man trades in the way I have described, he will always be in the profitable position of being able to cash in on the big bet.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The average speculator has arrayed against him his own nature. The weaknesses that all men are prone to are fatal to success in speculation -- usually those very weaknesses that make him likable to his fellows or that he himself particularly guards against in those other ventures of his where they are not nearly so dangerous as when he is trading in stocks or commodities.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The speculator's chief enemies are always boring from within. It is inseparable from human nature to hope and to fear. In speculation when the market goes against you -- you hope that every day will be the last day and you lose more than you should had you not listened to hope -- to the same ally that is so potent a success-bringer to empire builders and pioneers, big and little. And when the market goes your way you become fearful that the next day will take away your profit, and you get out too soon. Fear keeps you from making as much money as you ought to. The successful trader has to fight these two deep-seated instincts. He has to reverse what you might call his natural impulses. Instead of hoping he must fear; instead of fearing he must hope. He must fear that his loss may develop into a much bigger loss, and hope that his profit may become a big profit. It is absolutely wrong to gamble in stocks the way the average man does.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I have been in the speculative game ever since I was fourteen. It is all I have ever done. I think I know what I am talking about. And the conclusion that I have reached after nearly thirty years of constant trading, both on a shoestring and with millions of dollars back of me, is this: A man may beat a stock or a group at a certain time, but no man living can beat the stock market!&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;11&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;A trader gets to play the game as the professional billiard player does -- that is, he looks far ahead instead of considering the particular shot before him. It gets to be an instinct to play for position.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;That is one trouble about trading on a large scale. You cannot sneak out as you can when you pike along. You cannot always sell out when you wish or when you think it wise. You have to get out when you can; when you have a market that will absorb your entire line. Failure to grasp the opportunity to get out may cost you millions. You cannot hesitate. I f you do you are lost.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;12&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;A man cannot be convinced against his own convictions, but he can be talked into a state of uncertainty and indecision, which is even worse, for that means that he cannot trade with confidence and comfort.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I have done nothing in my life but trade in stocks and commodities. I naturally think that if it is wrong to be bearish it must be right to be a bull. And if it is right to be a bull it is imperative to buy. As my old Palm Beach friend said Pat Hearne used to say, "You can't tell till you bet!" I must prove whether I am right on the market or not; and the proofs are to be read only in my brokers' statements at the end of the month.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I did precisely the wrong thing. The cotton showed me a loss and I kept it. The wheat showed me a profit and I sold it out. It was an utterly foolish play, but all I can say in extenuation is that it wasn't really my deal, but Thomas'. Of all speculative blunders there are few greater than trying to average a losing game. My cotton deal proved it to the hilt a little later. Always sell what shows you a loss and keep what shows you a profit.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It cost me millions to learn that another dangerous enemy to a trader is his susceptibility to the urgings of a magnetic personality when plausibly expressed by a brilliant mind. It has always seemed to me, however, that I might have learned my lesson quite as well if the cost had been only one million. But Fate does not always let you fix the tuition fee. She delivers the educational wallop and presents her own bill, knowing you have to pay it, no matter what the amount may be. Having learned what folly I was capable of I closed that particular incident. Percy Thomas went out of my life.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The hope of making the stock market pay your bill is one of the most prolific sources of loss in Wall Street. You will chip out all you have if you adhere to your determination. There isn't a man in Wall Street who has not lost money trying to make the market pay for an automobile or a bracelet or a motor boat or a painting. I could build a huge hospital with the birthday presents that the tight-fisted stock market has refused to pay for. In fact, of all hoodoos in Wall Street I think the resolve to induce the stock market to act as a fairy godmother is the busiest and most persistent.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;13&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It was improper and unwise for me as a speculator to allow myself to be influenced by any consideration to act against my own judgment. Noblesse oblige, but not in the stock market, because the tape is not chivalrous and moreover does not reward loyalty.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I was very lucky. I was rampantly bullish in a wild bull market. Things were certainly coming my way so that there wasn't anything to do but to make money. It made me remember a saying of the late H. H. Rogers, of the Standard Oil Company, to the effect that there were times when a man could no more help making money than he could help getting wet if he went out in a rainstorm without an umbrella. It was the most clearly defined bull market we ever had.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Nowhere does history indulge in repetitions so often or so uniformly as in Wall Street. When you read contemporary accounts of booms or panics the one thing that strikes you most forcibly is how little either stock speculation or stock speculators today differ from yesterday. The game does not change and neither does human nature.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;A market does not culminate in one grand blaze of glory. Neither does it end with a sudden reversal of form. A market can and does often cease to be a bull market long before prices generally begin to break. My long expected warning came to me when I noticed that, one after another, those stocks which had been the leaders of the market reacted several points from the top and for the first time in many months -- did not come back. Their race evidently was run, and that clearly necessitated a change in my trading tactics.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It is enough for the experienced trader to perceive that something is wrong. He must not expect the tape to become a lecturer. His job is to listen for it to say "Get out!" and not wait for it to submit a legal brief for approval.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Then one day the entire market became quite weak and prices of all stocks began to fall. When I had a profit of at least four points in each and every one of the twelve stocks that I was short of, I knew that I was right. The tape told me it was now safe to be bearish, so I promptly doubled up... After I doubled up, I did not make another trade for a long time.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Never try to sell at the top. It isn't wise. Sell after a reaction if there is no rally.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;In a bear market it is always wise to cover if complete demoralisation suddenly develops. That is the only way, if you swing a good-sized line, of turning a big paper profit into real money both quickly and without regrettable reductions. For instance, I was short fifty thousand shares of United States Steel alone. Of course I was short of other stocks, and when I saw I had the market to cover in, I lid. My profits amounted to about one and a half million dollars. It was not a chance to disregard.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;14&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;We ran smack into a long moneyless period; four mighty lean years. There was not a penny to be made. As Billy Henriquez once said, "It was the kind of market in which not even a skunk could make a scent."&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I have come to feel that it is as necessary to know how to read myself as to know how to read the tape. I have studied and reckoned on my own reactions to given impulses or to the inevitable temptations of an active market, quite in the same mood and spirit as I have considered crop conditions or analysed reports of earnings.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;16&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It has always seemed to me the height of dam foolishness to trade on tips. I suppose I am not built the way a tip-taker is. I sometimes think that tip-takers are like drunkards. There are some who can't resist the craving and always look forward to those jags which they consider indispensable to their happiness. It is so easy to open your ears and let the tip in. To be told precisely what to do to be happy in such a manner that you can eagily obey is the next nicest thing to being happy which is a mighty long first step toward the fulfilment of your heart's desire. It is not so much greed made blind by eagerness as it is hope bandaged by the unwillingness to do any thinking.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Old Baron Rothschild's recipe for wealth winning applies with greater force than ever to speculation. Somebody asked him if making money in the Bourse was not a very difficult matter, and he replied that, on the contrary, he thought it was very easy. I will tell you my secret if you wish. It is this: I never buy at the bottom and I always sell too soon."&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;17&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The training of a stock trader is like a medical education. The physician has to spend long years learning anatomy, physiology, materia medica and collateral subjects by the dozen. He learns the theory and then proceeds to devote his life to the practice. He observes and classifies all sorts of pathological phenomena. He learns to diagnose. If his diagnosis is correct, and that depends upon the accuracy of his observation -- he ought to do pretty well in his prognosis, always keeping in mind, of course, that human fallibility and the utterly unforeseen will keep him from scoring 100 per cent of bull's eyes. And then, as he gains in experience, he. learns not only to do the right thing but to do it instantly, so that many people will think he does it instinctively. It really isn't automatism. It is that he has diagnosed the case according to his observations of such cases during a period of many years; and, naturally, after he has diagnosed it, he can only treat it in the way that experience has taught him is the proper treatment. You can transmit knowledge -- that is, your particular collection of card indexed facts, but not your experience. A man may know what to do and lose money -- if he doesn't do it quickly enough.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Observation, experience, memory and mathematics -- these are what the successful trader must depend on. He must bet always on probabilities -- that is, try to anticipate them. Years of practice at the game, of constant study, of always remembering, enable the trader to act on the instant when the unexpected happens as well as when the expected comes to pass.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I have found that experience is apt to be steady dividend payer in this game and that observation gives you the best tips of all. The behaviour of a certain stock is all you need at times. You observe it.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;I never buy a stock even in a bull market, if it doesn't act as it ought to act in that kind of market.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;An old broker once said to me: "If I am walking along a railroad track and I see a train coming toward me at sixty miles an hour, do I keep on walking on the ties? Friend, I sidestep. And I do not even pat myself on the back for being so wise and prudent."&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Experiences had taught me to beware of buying a stock that refuses to follow the group-leader.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;18&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It was not difficult to be both fearless and patient. A speculator must have faith in himself and in his judgment. The late Dickson G. Watts, ex-President of the New York Cotton Exchange and famous author of "Speculation as a Fine Art," says that courage in a speculator is merely confidence to act on the decision of his mind. With me, I cannot fear to be wrong because I never think I am wrong until I am proven wrong. In fact, I am uncomfortable unless I am capitalising my experience. The course of the market at a given time does not necessarily prove me wrong. It is the character of the advance or of the decline that determines for me the correctness or the fallacy of my market position. I can only rise by knowledge. If I fall it must be by my own blunders.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;19&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The study of the psychology of speculators is as valuable as it ever was. Weapons change, but strategy remains strategy, on the New York Stock Exchange as on the battlefield. I think the clearest summing up of the whole thing was expressed by Thomas F. Woodlock when he declared: "The principles of successful stock speculation are based on the supposition that people will continue in the future to make the mistakes that they have made in the past."&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;In booms, which is when the public is in the market in the greatest numbers, there is never any need of subtlety, so there is no sense of. wasting time: discussing either manipulation or speculation during such times; it would be like trying to find the difference in raindrops that are falling synchronously on the same roof across the street. The sucker has always tried to get something for nothing, and the appeal in all booms is always frankly to the gambling instinct aroused by cupidity and spurred by a pervasive prosperity. People who look for easy money invariably pay for the privilege of proving conclusively that it cannot be found on this sordid earth. At first, when I listened to the accounts of old-time deals and devices I used to think that people were more gullible in the i86o's and '7o's than in the igoo's. But I was sure to read in the newspapers that very day or the next something about the latest Ponzi or the bust-up of some bucketing broker and about the millions of sucker money gone to join th,silent majority of vanished savings.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;20&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;He did not argue with the tape is plain. He was utterly fearless but never reckless. He could and did turn in a twinkling, if he found he was wrong.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;There is no question that advertising is an art, and manipulation is the art of advertising through the medium of the tape. The tape should tell the story the manipulator wishes its readers to see. The truer the story the more convincing it is bound to be, and the more convincing it is the better the advertising is. A manipulator today, for instance, has not only to make a stock look strong but also to make it be strong. Manipulation therefore must be based on sound trading principles. That is what made Keene such a marvellous manipulator; he was a consummate trader to begin with.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It is well to remember a rule of manipulation, a rule that Keene and his able predecessors well knew. It is this: Stocks are manipulated to the highest point possible and then sold to the public on the way down.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The first step in a bull movement in a stock is to advertise the fact that there is a bull movement on. Sounds silly, doesn't it? Well, think a moment. It isn't as silly as it sounded, is it? The most effective way to advertise what, in effect, are your honourable intentions is to make the stock active and strong. After all is said and done, the greatest publicity agent in the wide world is the ticker, and by far the best advertising medium is the tape.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;It is always well to make it plain to the traders and to the public, also that there is a demand for the stock on the way down. That tends to check both reckless short selling by the professionals and liquidation by frightened holders which is the selling you usually see when a stock gets weaker and weaker, which in turn is what a stock does when it is not supported. These covering purchases of mine constitute what I call the stabilising process. As the market broadens I of course sell stock on the way up, but never enough to check the rise. This is in strict accordance with my stabilising plans. It is obvious that the more stock I sell on a reasonable and orderly advance the more I encourage the conservative speculators, who are more numerous than the reckless room traders; and in addition the more support I shall be able to give to the stock on the inevitable weak days. By always being short 'I always am in a position to support the stock without danger to myself. As a rule I begin my selling at a price that will show me a profit. But I often sell without having a profit, simply to create or to increase what I may call my riskless buying power. My business is not alone to put up the price or to sell a big block of stock for a client but to make money for myself. That is why I do not ask any clients to finance my operations. My fee is contingent upon my success.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;21&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The big money in booms is always made first by the public-on paper. And it remains on paper.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;22&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;[In the boom of 1915] It got so that all a man had to do was to say that he had a friend who was a friend of a member of one of the Allied commissions and he would be offered all the capital needed to carry out the contracts he had not yet secured. I used to hear incredible stories of clerks becoming presidents of companies doing a business of millions of dollars on money borrowed from trusting trust companies, and of contracts that left a trail of profits as they passed from man to man. A flood of gold was pouring into this country from Europe and the banks had to find ways of impounding it.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The way business was done might have been regarded with misgivings by the old, but there didn't seem to be so many of them about. The fashion for gray-haired presidents of banks was all very well in tranquil times, but youth was the chief qualification in these strenuous times. The banks certainly did make enormous profits.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;23&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;Manipulation of some sort enters into practically all advances in individual stocks and that such advances are engineered by insiders with one object in view and one only and that is to sell at the best profit possible.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;24&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span&gt;The public ought always to keep in mind the elementals of stock trading. When a stock is going up no elaborate explanation is needed as to why it is going up. It takes continuous to buying to make a stock keep on going up. As long as it does so, with only small and natural reactions from time to time, it is a pretty safe proposition to trail along with it. But if after a long steady rise a stock turns and gradually begins to go down, with only occasional small rallies, it is obvious that the line of least resistance has changed from upward to downward. Such being the case why should any one ask for explanations? There are probably very good reasons why it should go down, but these reasons are known only to a few people  who either keep those reasons to themselves, or else actually tell the public that the stock is cheap. The nature of the game as it is played is such that the public should realise that the truth cannot be told by the few who know.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-6630026975701253564?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/6630026975701253564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=6630026975701253564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/6630026975701253564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/6630026975701253564'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2011/12/reminiscences-of-stock-operator-quotes.html' title='Reminiscences of a Stock Operator  -- Quotes'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-HH-1BGvUs-M/TvYzfUqy7EI/AAAAAAAAAGc/ZDc-DQaeY3c/s72-c/ephesusInscriptions.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-2557503468227635553</id><published>2011-01-09T10:27:00.001-08:00</published><updated>2011-01-09T11:21:21.023-08:00</updated><title type='text'>Java Concurrency In Practice</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Although with new cutting edge devices, computing performance is increasing continuously,  still high performance and low latency programming plays an important role to utilise these devices. Unlike other programming languages such as C/C++, Java provides compact, portable,  optimum, intuitive, built-in components to take full advantage resources to provide high performance computing. In this text, i wont claim that Java provides better performance amongst other available languages (there are enough blogs about these benchmarks). I will focus on how to use Java to develop high performance application. Similar to some of my other articles, i will use a book, &lt;a href="http://www.javaconcurrencyinpractice.com/"&gt;Java Concurrency in Practice&lt;/a&gt;, to explain concurrency in java. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Without a doubt, Java Concurrency in Practice is an unique book in this field. It is a must reading for every Java concurrency developer.  The authors have first hand experience in  developing concurrency and threading package at Sun and have enormous experience in practice. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;Concurrency is not a new subject in software development. Similar to other engineering problems, utilising available resources with fairness and convenience is always being one of the main objective in software development. To utilise finite and costly resources with fairness and convenience, java provides a highly optimised, compact concurrency framework which includes threads, thread execution services, memory sharing facilities, concurrent or synchronized data structures, explicit and implicit  locks , and atomic variable. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Threads&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;To take full advantage of available resources (CPU, memory, disk, network), multiple threads can be started in an application. A thread is similar to process but its life cycle is bounded with main thread (process) and managed by main threads.  Each thread has its own stack for local variable and execution path but  uses shared heap memory for global objects. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Threads provide parallel processing in application,  simplicity of modelling, handling of asynchronous events, and more responsive feedback.  Parallel processing is obtained by exploiting available (or by simulating) multiple processors.  Dividing whole problem space or task into sub problem space or  sub tasks and then assigning  each part to a thread, naturally, is a simple modelling to solve complex problem.  Since many resources are asynchronous, such as I/O resources, non-blocking threads  would also provide high utilization of resources.  One of other advantages of thread is responsiveness.  By assigning specific tasks (UI interaction) to specific threads (GUI thread), a better response and throughput would be obtained.  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Java uses different platform specific frameworks to implement threads (for example, PThreads for Linux) and therefore some limitation is platform specific. For example, there is a theoretical maximum number of threads in each platform.  But in practice for high performance computing, number of thread is strictly correlated with number of available processor and idle time between subtasks executions.&lt;/div&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;Threads are very common in software development. Even an application does not use explicitly thread itself, libraries or frameworks used in this application use thread. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Risk of Threads&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;As explained above threads provides many benefits. But these benefits comes with cost of safety, liveness and performance.  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Since many threads would access mutable shared objects and resources at same time, they would cause inconsistent object and resource states. Therefore, when accessing shared objects, a thread safe mechanism must be deployed to protect consistency of mutable object's states. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;In order to provide thread safety, several mechanism, such as lock or synchronization are used. While these mechanism provides safety, they would also block or limit accessing resources therefore causes liveness issues. If threads are not managed very well, it would cause extra overhead, performance issues during context switching between threads and synchronization.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Thread Safety&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;If a shared and mutable object is shared by many thread at same time, state of this object can become inconsistent if proper synchronization is not applied over shared object, as many thread can access and modify the object at same time. In order to protect a consistent and deterministic state of object , one of the following has to be done:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;Don't share the object across threads&lt;/li&gt;&lt;li&gt;Make the object is immutable&lt;/li&gt;&lt;li&gt;Use synchronization mechanisms to control  access and modification of shared object by multiple objects.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;In the book, thread safe is defined as follows:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;"A class is thread-safe if it behaves correctly when accessed from multiple threads, regardless of the scheduling or interleaving of the execution of those threads by the runtime environment, and with no additional synchronization or other coordination on the part of the calling code."&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Good object oriented techniques such as encapsulation, immutability would improve thread safety.  With encapsulation inner states of objects and synchronized blocks would be hidden from clients.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Thread safety can be obtained by implementing good synchronization mechanism with: &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Implicit locking:&lt;/b&gt; Accessing a resource is blocked with implicit lock of an object.  In java, each object holds an implicit lock.  synchronized  keyword is used to acquire implicit lock of an object. And with  volatile keyword, memory visibility can be guaranteed.  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;void synchronized myMethod() {&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// Access or modify shared state guarded by "this"&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;void static synchronized myMethod() {&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// Access or modify shared state guarded by class itself&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;void synchronized (lock) {&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;// Access or modify shared state guarded by lock object&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Explicit locking:&lt;/b&gt;  In addition to implicit locks, java provides more flexible locking classes for various situations. Some of these classes are: ReentrantLock, Semaphore, ReentrantReadWriteLock, CountDownLatch, SynchronousQueue, and FutureTask&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Atomic variables:&lt;/b&gt; Some operations, such as increasing a shared counter variable in a multithreaded environment must be atomic. By atomic, we mean, access and modify operation has to be done automatic. Java uses  Compare and Swap (CAS) mechanism with underlying platform specific functions to implement atomicity.   Some of these atomic classes are: AtomicInteger, AtomicLong, AtomicBoolean, AtomicReference &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Built-in concurrent or synchronized data structures:&lt;/b&gt; Java provides various built-in thread safe data structures such as Vector, Hashtable, java.util.concurrent.*, ...&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;When a thread enters a synchronized or locked block, it must hold or acquire lock to enter the synchronized or locked block. Otherwise, threads are blocked on the lock. In Java locks are reentrant, in another words, if a thread holds a lock in a synchronized block and if reenters the block with same lock, the thread wont be blocked. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Sharing Objects&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;If mutable objects are not shared between threads, there wont be much headache in developing multi thread applications.  In practice, there are not many multi-threaded applications which does not share mutable objects across threads.  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;When a mutable object is shared, it must be guarded  to restrict modification at same time by multiple threads. Once modification is done, latest state of the shared object must be visible to other threads immediately. Visibility of a shared object is guaranteed with locks (implicit and explicit locks such as &lt;i&gt;synchronized&lt;/i&gt;) and &lt;i&gt;volatility &lt;/i&gt;keyword. In other words, for example, &lt;i&gt;synchronized &lt;/i&gt;keywords does not only prevent multiple thread to access an object, but it also publish state of the object immediately to other threads once &lt;i&gt;synchronized &lt;/i&gt;block is completed.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Without visibility and publication feature of synchronization, object can be in stale state where data may not be up to date for other threads.  Nonetheless, when a thread reads a variable, it reads a value which is stored there by a thread (maybe be not latest data but it is not random data).  This safety guarantee is called&lt;i&gt; out-of-thin-air&lt;/i&gt; safety. This is guaranteed for all variable apart from 64 bit variable such as double and long. This variable has to be declared as volatile  otherwise, JVM would fetch these variables in two 32 bit operations. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;An object must be  encapsulated well to not expose inner state. Otherwise, exposed or escaped inner state of an object would cause inconsistent state and invisibility issue across threads.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;The most useful policies for using and sharing objects in a concurrent program are: Thread-confinement,  immutability, (shared read-only),using built-in thread-safe objects, guarded by specific lock. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Thread Confinement and ThreadLocal   &lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;As mentioned before, If an object is not shared by multiple thread and accessed only by one thread, thread safety will  be guaranteed automatically. This technique is called thread confinement. Thread confinement is extensively used in some frameworks such as Swing and JDBC. &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Thread confinement can be implemented in various ways, two of which are very popular: Stack confinement and ThreadLocal. In the first method, shared objects are locally copied/cloned (therefore an instance of them is created in stack) before they are modified or accessed by a thread.  But more formal and built-in confinement method is ThreadLocal which holds a copy of an object for a thread. In other words, it is a pair-value, container, which provides &lt;i&gt;initialValue&lt;/i&gt;, &lt;i&gt;set &lt;/i&gt;and &lt;i&gt;get &lt;/i&gt;methods.  &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;Immutability&lt;/b&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Immutable objects can be used safely by any thread without additional synchronization, even when synchronization is not used to publish them.  An object can be immutable either:&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;ul&gt;&lt;li&gt;All its fields are final&lt;/li&gt;&lt;li&gt;Its state can not be changed after construction&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" &gt; .... To be Continued&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-2557503468227635553?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/2557503468227635553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=2557503468227635553' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2557503468227635553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2557503468227635553'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2011/01/java-concurrency-in-practice.html' title='Java Concurrency In Practice'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-1802030804096205264</id><published>2010-12-06T13:20:00.000-08:00</published><updated>2010-12-19T03:37:41.988-08:00</updated><title type='text'>Effective C++ (55 Specific Ways)</title><content type='html'>&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;1: View C++ as a federation of languages&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" &gt;Rules for effective C++ programming vary, depending on the part of C++ ( (C, Object Oriented C++, Template C++, STL) you are using.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;2: Prefer consts, enums, and inlines to #defines&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;For simple constants, prefer const objects or enums to #defines.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;For function-like macros, prefer inline functions to #defines.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;3: Use const whenever possible&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Declaring something const helps compilers detect usage errors. const can be applied to objects at any scope, to function parameters and return types, and to member functions as a whole.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Compilers enforce bitwise constness, but you should program using conceptual constness.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When const and non-const member functions have essentially identical implementations, code duplication can be avoided by having the non-const version call the const version.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;4: Make sure that objects are initialized before they're used&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Manually initialize objects of built-in type, because C++ only sometimes initializes them itself.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;In a constructor, prefer use of the member initialization list to assignment inside the body of the constructor. List data members in the initialization list in the same order they're declared in the class.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Avoid initialization order problems across translation units by replacing non-local static objects with local static objects.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;5: Know what functions C++ silently writes and calls&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Compilers may implicitly generate a class's default constructor, copy constructor, copy assignment operator, and destructor.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;6: Explicitly disallow the use of compiler-generated functions you do not want&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;To disallow functionality automatically provided by compilers, declare the corresponding member functions private and give no implementations. Using a base class like Uncopyable is one way to do this.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;7: Declare destructors virtual in polymorphic base classes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Polymorphic base classes should declare virtual destructors. If a class has any virtual functions, it should have a virtual destructor.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Classes not designed to be base classes or not designed to be used polymorphically should not declare virtual destructors.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;8: Prevent exceptions from leaving destructors&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Destructors should never emit exceptions. If functions called in a destructor may throw, the destructor should catch any exceptions, then swallow them or terminate the program.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;If class clients need to be able to react to exceptions thrown during an operation, the class should provide a regular (i.e., non-destructor) function that performs the operation.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;9: Never call virtual functions during construction or destruction&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Don't call virtual functions during construction or destruction, because such calls will never go to a more derived class than that of the currently executing constructor or destructor.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;10: Have assignment operators return a reference to *this&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Have assignment operators return a reference to *this.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;11: Handle assignment to self in operator=&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Make sure operator= is well-behaved when an object is assigned to itself. Techniques include comparing addresses of source and target objects, careful statement ordering, and copy-and-swap.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Make sure that any function operating on more than one object behaves correctly if two or more of the objects are the same.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;12: Copy all parts of an object&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Copying functions should be sure to copy all of an object's data members and all of its base class parts.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Don't try to implement one of the copying functions in terms of the other. Instead, put common functionality in a third function that both call.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 13: Use objects to manage resources.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;To prevent resource leaks, use RAII objects that acquire resources in their constructors and release them in their destructors.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Two commonly useful RAII classes are TR1::shared_ptr and auto_ptr. tr1::shared_ptr is usually the better choice, because its behavior when copied is intuitive. Copying an auto_ptr sets it to null.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 14: Think carefully about copying behavior in resource-managing classes.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Copying an RAII object entails copying the resource it manages, so the copying behavior of the resource determines the copying behavior of the RAII object.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Common RAII class copying behaviors are disallowing copying and performing reference counting, but other behaviors are possible.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 15: Provide access to raw resources in resource-managing classes.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;APIs often require access to raw resources, so each RAII class should offer a way to get at the resource it manages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Access may be via explicit conversion or implicit conversion. In general, explicit conversion is safer, but implicit conversion is more convenient for clients.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 16: Use the same form in corresponding uses of new and delete.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;If you use [] in a new expression, you must use [] in the corresponding delete expression. If you don't use [] in a new expression, you mustn't use [] in the corresponding delete expression.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 17: Store newed objects in smart pointers in standalone statements.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Store newed objects in smart pointers in standalone statements. Failure to do this can lead to subtle resource leaks when exceptions are thrown.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 18: Make interfaces easy to use correctly and hard to use incorrectly&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Good interfaces are easy to use correctly and hard to use incorrectly. Your should strive for these characteristics in all your interfaces.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Ways to facilitate correct use include consistency in interfaces and behavioral compatibility with built-in types.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Ways to prevent errors include creating new types, restricting operations on types, constraining object values, and eliminating client resource management responsibilities.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;TR1::shared_ptr supports custom deleters. This prevents the cross-DLL problem, can be used to automatically unlock mutexes (see Item 14), etc.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 19: Treat class design as type design&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Class design is type design. Before defining a new type, be sure to consider all the issues discussed in this Item.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 20: Prefer pass-by-reference-to-const to pass-by-value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Prefer pass-by-reference-to-const over pass-by-value. It's typically more efficient and it avoids the slicing problem.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;The rule doesn't apply to built-in types and STL iterator and function object types. For them, pass-by-value is usually appropriate.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 21: Don't try to return a reference when you must return an object&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Never return a pointer or reference to a local stack object, a reference to a heap-allocated object, or a pointer or reference to a local static object if there is a chance that more than one such object will be needed. (Item 4 provides an example of a design where returning a reference to a local static is reasonable, at least in single-threaded environments.)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 22: Declare data members private&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Declare data members private. It gives clients syntactically uniform access to data, affords fine-grained access control, allows invariants to be enforced, and offers class authors implementation flexibility.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;protected is no more encapsulated than public.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 23: Prefer non-member non-friend functions to member functions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Prefer non-member non-friend functions to member functions. Doing so increases encapsulation, packaging flexibility, and functional extensibility.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 24: Declare non-member functions when type conversions should apply to all parameters&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;If you need type conversions on all parameters to a function (including the one pointed to by the this pointer), the function must be a non-member.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 25: Consider support for a non-throwing swap&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Provide a swap member function when std::swap would be inefficient for your type. Make sure your swap doesn't throw exceptions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;If you offer a member swap, also offer a non-member swap that calls the member. For classes (not templates), specialize std::swap, too.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When calling swap, employ a using declaration for std::swap, then call swap without namespace qualification.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;It's fine to totally specialize std templates for user-defined types, but never try to add something completely new to std.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Item 26: Postpone variable definitions as long as possible.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Postpone variable definitions as long as possible. It increases program clarity and improves program efficiency.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 27: Minimize casting.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Avoid casts whenever practical, especially dynamic_casts in performance-sensitive code. If a design requires casting, try to develop a cast-free alternative.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When casting is necessary, try to hide it inside a function. Clients can then call the function instead of putting casts in their own code.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Prefer C++-style casts to old-style casts. They are easier to see, and they are more specific about what they do.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 28: Avoid returning "handles" to object internals.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Avoid returning handles (references, pointers, or iterators) to object internals. It increases encapsulation, helps const member functions act const, and minimizes the creation of dangling handles.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item29: Strive for exception-safe code.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Exception-safe functions leak no resources and allow no data structures to become corrupted, even when exceptions are thrown. Such functions offer the basic, strong, or nothrow guarantees.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;The strong guarantee can often be implemented via copy-and-swap, but the strong guarantee is not practical for all functions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;A function can usually offer a guarantee no stronger than the weakest guarantee of the functions it calls.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 30: Understand the ins and outs of inlining.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Limit most inlining to small, frequently called functions. This facilitates debugging and binary upgradability, minimizes potential code bloat, and maximizes the chances of greater program speed.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Don't declare function templates inline just because they appear in header files.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item31: Minimize compilation dependencies between files.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;The general idea behind minimizing compilation dependencies is to depend on declarations instead of definitions. Two approaches based on this idea are Handle classes and Interface classes.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Library header files should exist in full and declaration-only forms. This applies regardless of whether templates are involved.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 32: Make sure public inheritance models "is-a."&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Public inheritance means "is-a." Everything that applies to base classes must also apply to derived classes, because every derived class object is a base class object.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 33: Avoid hiding inherited names&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Names in derived classes hide names in base classes. Under public inheritance, this is never desirable.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;To make hidden names visible again, employ using declarations or forwarding functions.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 34: Differentiate between inheritance of interface and inheritance of implementation&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Inheritance of interface is different from inheritance of implementation. Under public inheritance, derived classes always inherit base class interfaces.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Pure virtual functions specify inheritance of interface only.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Simple (impure) virtual functions specify inheritance of interface plus inheritance of a default implementation.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Non-virtual functions specify inheritance of interface plus inheritance of a mandatory implementation.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 35: Consider alternatives to virtual functions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Alternatives to virtual functions include the NVI idiom and various forms of the Strategy design pattern. The NVI idiom is itself an example of the Template Method design pattern.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;A disadvantage of moving functionality from a member function to a function outside the class is that the non-member function lacks access to the class's non-public members.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;tr1::function objects act like generalized function pointers. Such objects support all callable entities compatible with a given target signature.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 36: Never redefine an inherited non-virtual function&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Never redefine an inherited non-virtual function.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 37: Never redefine a function's inherited default parameter value&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Never redefine an inherited default parameter value, because default parameter values are statically bound, while virtual functions — the only functions you should be overriding — are dynamically bound.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 38: Model "has-a" or "is-implemented-in-terms-of" through composition&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Composition has meanings completely different from that of public inheritance.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;In the application domain, composition means has-a. In the implementation domain, it means is-implemented-in-terms-of.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 39: Use private inheritance judiciously&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Private inheritance means is-implemented-in-terms of. It's usually inferior to composition, but it makes sense when a derived class needs access to protected base class members or needs to redefine inherited virtual functions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Unlike composition, private inheritance can enable the empty base optimization. This can be important for library developers who strive to minimize object sizes.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 40: Use multiple inheritance judiciously&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Multiple inheritance is more complex than single inheritance. It can lead to new ambiguity issues and to the need for virtual inheritance.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Virtual inheritance imposes costs in size, speed, and complexity of initialization and assignment. It's most practical when virtual base classes have no data.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Multiple inheritance does have legitimate uses. One scenario involves combining public inheritance from an Interface class with private inheritance from a class that helps with implementation.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 41: Understand implicit interfaces and compile-time polymorphism&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Both classes and templates support interfaces and polymorphism.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;For classes, interfaces are explicit and centered on function signatures. Polymorphism occurs at runtime through virtual functions.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;For template parameters, interfaces are implicit and based on valid expressions. Polymorphism occurs during compilation through template instantiation and function overloading resolution.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Item 42: Understand the two meanings of typename&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When declaring template parameters, class and typename are interchangeable.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Use typename to identify nested dependent type names, except in base class lists or as a base class identifier in a member initialization list.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 43: Know how to access names in templatized base classes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;In derived class templates, refer to names in base class templates via a "this-&gt;" prefix, via using declarations, or via an explicit base class qualification.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 44: Factor parameter-independent code out of templates&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Templates generate multiple classes and multiple functions, so any template code not dependent on a template parameter causes bloat.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Bloat due to non-type template parameters can often be eliminated by replacing template parameters with function parameters or class data members.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Bloat due to type parameters can be reduced by sharing implementations for instantiation types with identical binary representations.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 45: Use member function templates to accept "all compatible types."&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Use member function templates to generate functions that accept all compatible types.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;If you declare member templates for generalized copy construction or generalized assignment, you'll still need to declare the normal copy constructor and copy assignment operator, too.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 46: Define non-member functions inside templates when type conversions are desired&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When writing a class template that offers functions related to the template that support implicit type conversions on all parameters, define those functions as friends inside the class template.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Item 47: Use traits classes for information about types&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Traits classes make information about types available during compilation. They're implemented using templates and template specializations.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;In conjunction with overloading, traits classes make it possible to perform compile-time if...else tests on types.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;48: Be aware of template metaprogramming&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Template metaprogramming can shift work from runtime to compile-time, thus enabling earlier error detection and higher runtime performance.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;TMP can be used to generate custom code based on combinations of policy choices, and it can also be used to avoid generating code inappropriate for particular types.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;49: Understand the behavior of the new-handler&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;set_new_handler allows you to specify a function to be called when memory allocation requests cannot be satisfied.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Nothrow new is of limited utility, because it applies only to memory allocation; subsequent constructor calls may still throw exceptions.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;50: Understand when it makes sense to replace new and delete&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;There are many valid reasons for writing custom versions of new and delete, including improving performance, debugging heap usage errors, and collecting heap usage information.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;51: Adhere to convention when writing new and delete&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;operator new should contain an infinite loop trying to allocate memory, should call the new-handler if it can't satisfy a memory request, and should handle requests for zero bytes. Class-specific versions should handle requests for larger blocks than expected.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;operator delete should do nothing if passed a pointer that is null. Class-specific versions should handle blocks that are larger than expected.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;52: Write placement delete if you write placement new&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When you write a placement version of operator new, be sure to write the corresponding placement version of operator delete. If you don't, your program may experience subtle, intermittent memory leaks.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;When you declare placement versions of new and delete, be sure not to unintentionally hide the normal versions of those functions.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;53: Pay attention to compiler warnings.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Take compiler warnings seriously, and strive to compile warning-free at the maximum warning level supported by your compilers.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Don't become dependent on compiler warnings, because different compilers warn about different things. Porting to a new compiler may eliminate warning messages you've come to rely on.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;54: Familiarize yourself with the standard library, including TR1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;The primary standard C++ library functionality consists of the STL, iostreams, and locales. The C99 standard library is also included.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;TR1 adds support for smart pointers (e.g., tr1::shared_ptr), generalized function pointers (tr1::function), hash-based containers, regular expressions, and 10 other components.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;TR1 itself is only a specification. To take advantage of TR1, you need an implementation. One source for implementations of TR1 components is Boost.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;55: Familiarize yourself with Boost.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Boost is a community and web site for the development of free, open source, peer-reviewed C++ libraries. Boost plays an influential role in C++ standardization.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; "&gt;Boost offers implementations of many TR1 components, but it also offers many other libraries, too.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-1802030804096205264?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/1802030804096205264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=1802030804096205264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/1802030804096205264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/1802030804096205264'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2010/12/effective-c-55-specific-ways.html' title='Effective C++ (55 Specific Ways)'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-539195015108363677</id><published>2010-04-23T01:28:00.000-07:00</published><updated>2010-04-26T03:19:41.736-07:00</updated><title type='text'>Trading Strategies Involving Options</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;Unlike other derivatives (future, forward, swap), options provides flexibility (right to buy or sell an underlying instrument) in trading without any obligation. However, that’s flexibility comes with a cost. There are various techniques to estimate this cost, in other words price an option. I mentioned some of them in my previous blogs (Black Scholes, Monte Carlo, and Binomial Trees). In this blog, I will address on trading methods involving options. These methods are explained in great details in &lt;/span&gt;&lt;a href="http://www.rotman.utoronto.ca/~hull/ofod/" target="_blank"&gt;&lt;span class="Normal__Char Apple-style-span"  style=" color: rgb(0, 0, 255); font-family:Arial;"&gt;&lt;u&gt;Options, Futures, and Other Derivatives &lt;/u&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;by J. Hull and &lt;/span&gt;&lt;a href="http://books.global-investor.com/books/20122/Andrew-M.-Chisholm/Derivatives-Demystified/" target="_blank"&gt;&lt;span class="Normal__Char Apple-style-span"  style=" color: rgb(0, 0, 255); font-family:Arial;"&gt;&lt;u&gt;Derivatives Demystified &lt;/u&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;by Andrew M. Chisholm.&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:130%;"&gt;Combination of Single Option and Stocks&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;This is the simplest strategies involving single option and underlying stock at same time. Please not in this text; we use European option in examples and these ideas can be used for American options too.&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;For example, a portfolio consists of a long position in an underlying and a short position in the call option, which is called as “&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;b&gt;writing covered call&lt;/b&gt;&lt;/span&gt;” (Figure 1-a). This portfolio protects against sudden rise in underlying stock, which affects payoff short call in a negative way. Similarly, a portfolio with short position in underlying and long call (Figure 1-b) protects against sharp rises in short underlying.&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;Other common single option strategy involves put options such as &lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;b&gt;“protective put” &lt;/b&gt;&lt;/span&gt;(Figure 1-c) which consists of short underlying and put option. Short put option is protected with a short underlying. Long put option with long underlying (Figure 1-d) is used against sharp decline in the underlying.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9Fa0CNLsLI/AAAAAAAAAEU/xeo5wpB-t5w/s1600/singleStockAndOptions.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 546px; height: 400px;" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9Fa0CNLsLI/AAAAAAAAAEU/xeo5wpB-t5w/s400/singleStockAndOptions.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5463247672968982706" /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); -webkit-text-decorations-in-effect: none; "&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style=" font-weight: normal; font-family:'Times New Roman';"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; display: inline !important; "&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9Fa0CNLsLI/AAAAAAAAAEU/xeo5wpB-t5w/s1600/singleStockAndOptions.JPG"&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:130%;"&gt;Spreads&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/b&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style=" font-weight: normal; font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;This strategy involves of two or more options of same types and aims to profit from spreads caused by various combinations of strikes, maturity date and economical factors.&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;&lt;b&gt;Bull Spreads&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"  style=" ;font-family:Arial;"&gt;If an investor would like to take advantage of increase in an underlying, this strategy would be used. Bull spreads employ two call options on same underlying with two different strike price (K1 and K2) . While option with higher K1 strike is shorted, other call option with lower K2 strike is longed in anticipation that in a bull market, the spread between K1 and K2 strike generates a profit.  Table 1 and figure shows payoff from a bull spread strategy.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VjocenBOI/AAAAAAAAAEc/llj9UCIxOvc/s1600/bullSpreadTable.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 165px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VjocenBOI/AAAAAAAAAEc/llj9UCIxOvc/s400/bullSpreadTable.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464383269374461154" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n3R9tfLFKTo/S9VkPzQTwfI/AAAAAAAAAEk/kl02ery3rj8/s1600/bullSpreadFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 255px;" src="http://2.bp.blogspot.com/_n3R9tfLFKTo/S9VkPzQTwfI/AAAAAAAAAEk/kl02ery3rj8/s400/bullSpreadFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464383945503392242" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Bear Spreads&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;Unlike bear spread, if an underlying has potential to go down, bear spreads can be used. A short put option with lower K1 strike together with a long put option with higher K2 strike are used for bear spreads.  Table 2 and figure 3 summarize the pay-off for bear spreads. Upside profit potential and downside risk is limited. Maximum payoff is K2-K1 spread when underlying price is less than K1.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n3R9tfLFKTo/S9VliDlO8FI/AAAAAAAAAFE/ugloom_36aQ/s1600/bearSpreadTable.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 152px;" src="http://2.bp.blogspot.com/_n3R9tfLFKTo/S9VliDlO8FI/AAAAAAAAAFE/ugloom_36aQ/s400/bearSpreadTable.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464385358635397202" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/S9VkpkjHaQI/AAAAAAAAAE0/x7bN_Jl9YOs/s1600/bearSpreadFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 249px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/S9VkpkjHaQI/AAAAAAAAAE0/x7bN_Jl9YOs/s400/bearSpreadFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464384388232341762" /&gt;&lt;/a&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Box Spreads&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;This is a strategy used by arbitrage trader if an arbitrage opportunity occurs. Box spreads involves of bull and bear spreads with same K1 and K2 strike prices which generates always K2-K1 payoff, as table 3 illustrates. Therefore price of a box spread should be present value the payoff ((K2-K1)*exp(-rT)), if an arbitrage opportunity for investor is not wanted.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/S9Vk6Z1026I/AAAAAAAAAE8/1LIkCRbg_po/s1600/boxSpreadTable.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 154px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/S9Vk6Z1026I/AAAAAAAAAE8/1LIkCRbg_po/s400/boxSpreadTable.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464384677415803810" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Butterfly Spreads&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;In bear and bull spreads, investor positions himself/herself according to a potential upward or downward movement in underlying. On the other hand, in generic butterfly spread, investor positions himself/herself according to not volatile and moving underlying. In another words, if an investor thinks an underlying won’t go down nor up, he can buy butterfly spreads. Three different strike price with four call options are used:  A long call with lower K1 strike price, and again a long call with higher K3 strike price and two short call with K2 strike (between K1 and K3, generally close to current underlying price (K3+K1)/2).  As table 4 shows, if stock price stay close to around K2 a profit can be made. Butterfly spreads requires a small amount of cash investment at the beginning.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VmG3eFA7I/AAAAAAAAAFU/u-eosKYPK-k/s1600/butterflySpreadTable.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 152px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VmG3eFA7I/AAAAAAAAAFU/u-eosKYPK-k/s400/butterflySpreadTable.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464385991039321010" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VmENPoH4I/AAAAAAAAAFM/2k-tzlVjuo4/s1600/butterflySpreadFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 295px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VmENPoH4I/AAAAAAAAAFM/2k-tzlVjuo4/s400/butterflySpreadFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464385945344679810" /&gt;&lt;/a&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;Butterfly spreads can be created with also put options: Two long put options with lower strike price K1 and higher strike price K3 and two short put options with strike price K2 which is between K1 and K3.  If European put options are used, result will be same as call option’s butterfly spread.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;One last point, butterfly spreads can be shorted or sold if it is thought an underlying goes either up or down but not sure which direction, which produces modest payoff if there is a major movement in any direction.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Calendar Spreads&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;So far, in all spreads, the variant element was strike price and expire date was same.  In calendar spreads, variant element is expire date and strike price is constant for all options. For example, a short call option with short-maturity and a long call option with relatively longer-maturity can be used to create a calendar spreads. Since, longer-maturity call option will cost more than short call option, an initial cash flow out happens. When short-maturity short option expires, long call option is sold. Similar to butterfly spreads, if underlying price stay close to strike price, investor will make profit. Otherwise, a loss is incurred.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VmZ6FJ_jI/AAAAAAAAAFc/oxJb_0XJG8U/s1600/calendarSpreadFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 338px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9VmZ6FJ_jI/AAAAAAAAAFc/oxJb_0XJG8U/s400/calendarSpreadFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464386318157610546" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;Similar to butterfly spreads, put options can be used to construct calendar spreads. Strike price in a calendar spread is chosen according to trend of underlying. In bullish and bearish sentiment, higher and lower strike price is chosen, respectively.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Diagonal Spreads&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;In this strategy, options with different strike and expiration date are used. Analyzing outcome of these strategies is more complex than other spread strategies. Advanced models are used to estimate payoff.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:130%;"&gt;Combinations&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;In this strategy, put and call options are used at same time with same underlying.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Straddle&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;In this common strategy, a put and call option are purchased with same strike and expiration date. Unlike butterfly strategy, if a significant movement in underlying price happens in any direction, this strategy produces a significant profit. Table 5 and Figure 6 depict payoff of straddle.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/S9VmpPKhuNI/AAAAAAAAAFs/UVzv-fV77F0/s1600/straddleFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 375px; height: 271px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/S9VmpPKhuNI/AAAAAAAAAFs/UVzv-fV77F0/s400/straddleFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464386581515319506" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9Vmmp9u_2I/AAAAAAAAAFk/tFLF_ms4IWE/s1600/straddleFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 375px; height: 271px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/S9Vmmp9u_2I/AAAAAAAAAFk/tFLF_ms4IWE/s400/straddleFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464386537169813346" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;A reverse straddle can also be created selling put and call option with same strike price and expire date which is highly risky, if price of underlying changes significantly. On the other hand, similar to butterfly spreads, significant profit can be made if  price of underlying is around strike price.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt; &lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;&lt;b&gt;Strips and Straps&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;As mentioned above, straddle is good if we are not certain about direction of movement in underlying. But if we have stronger tendency about direction of movement in one way but still not sure about direction like in straddle, strips and straps can be used. Strips and straps are kind of biased straddles. A strip consists of long call and two put options on same underlying with same strike price and expiry date. Similarly, a strap consists of long put and two call options on same underlying with same strike price and expiry date.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9Vm3CffkwI/AAAAAAAAAF0/ChUc4yzGvag/s1600/stripStapFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 273px;" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9Vm3CffkwI/AAAAAAAAAF0/ChUc4yzGvag/s400/stripStapFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464386818631766786" /&gt;&lt;/a&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:arial;"&gt;&lt;b&gt;Strangles&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;p class="Normal" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: justify; "&gt;&lt;span class="Normal__Char Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-family:'arial';"&gt;In a strangle, an investor buys a put and call option with same expiration date with different strike prices. The strike price of put option (K1) is lower than the strike price of call option. This strategy is similar to straddles which bets on significant movement in underlying price(Figure 8).  But in strangle, further movement is required for profit. But risk is lesser compare to straddle. Risk can be adjusted with strike prices K1 and K2. The further they are apart, the less the downside risk and the farther the underlying price has to move to make a profit.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9VnDvB5JJI/AAAAAAAAAF8/sRn3peWYxiE/s1600/strangleFigure.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 253px;" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/S9VnDvB5JJI/AAAAAAAAAF8/sRn3peWYxiE/s400/strangleFigure.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5464387036745639058" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-539195015108363677?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/539195015108363677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=539195015108363677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/539195015108363677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/539195015108363677'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2010/04/trading-strategies-involving-options.html' title='Trading Strategies Involving Options'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n3R9tfLFKTo/S9Fa0CNLsLI/AAAAAAAAAEU/xeo5wpB-t5w/s72-c/singleStockAndOptions.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-2796312165702667066</id><published>2009-10-18T02:42:00.000-07:00</published><updated>2009-10-18T07:24:41.577-07:00</updated><title type='text'>Amending Code Style &amp; Templates Programmatically via Eclipse PDE</title><content type='html'>&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;Having a common code style and template in a development team is a good software development practice.  Fromatting source code with identical style and template reduces  synchronizing issues (such as merge, compare, check-in or check-out from a version controller, SVN/CVS) between developers. Many modern IDE's provide custom code format and template functionalities. In eclipse, under  Java &gt; Code Style&gt;Formatter and Code Templates menu, you can amend or create code styles and templates for your wish.&lt;br /&gt;&lt;br /&gt;In eclipse, once a template or code formatter is created, it can be exported and then distributed among team members. Then,  each developer has to manually import the code style and formatter.&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt; This is a manual task.&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;&lt;br /&gt;In this blog, i will give source code examples how to apply a code style or template programmatically with Eclipse plug-in development (PDE).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:georgia;font-size:85%;"  &gt;Code Style (Formatter)&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;Let's assume that we have sample code style and template  files (exported manually from eclipse and in xml format). For applying code style, we obtains default code style options with &lt;em&gt;JavaCore.getDefaultOptions()&lt;/em&gt; function and then ammend or insert new code style with their new/updated values.  And finally save back options.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; text-align: left; line-height: 20px; width: 99%; font-family: arial; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; height: auto; color: rgb(0, 0, 0); font-size: 12px;"&gt;&lt;span style="font-size:85%;"&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:georgia;"&gt;// Get the default options&lt;br /&gt;Hashtable options = JavaCore.getDefaultOptions();&lt;br /&gt;// Amend the value of an option&lt;br /&gt;options.put(JavaCore.COMPILER_PB_DEPRECATION, JavaCore.ERROR);&lt;br /&gt;// Save the new options&lt;br /&gt;JavaCore.setOptions(options);&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div&gt; &lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;Following source code shows &lt;/span&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;how a code format file in xml format  is applied programmatically with eclipse plug-in.  Please note, xmltools.jar library from mycila is used for parsing xml file.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; font-family: arial; font-size: 12px; width: 99%; height: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); text-align: left; line-height: 20px;"&gt;&lt;code style="color: rgb(0, 0, 0);"&gt; package com.denizstij.plugins.settings.codeformatter;&lt;br /&gt;import java.io.FileInputStream;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.Hashtable;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;import java.util.Map;&lt;br /&gt;import java.util.Set;&lt;br /&gt;import org.eclipse.jdt.core.JavaCore;&lt;br /&gt;import com.mycila.xmltool.XMLDoc;&lt;br /&gt;import com.mycila.xmltool.XMLTag;&lt;br /&gt;/**&lt;br /&gt;* Programmatically apply code styles via eclipse pde&lt;br /&gt;*&lt;br /&gt;* @author deniz.turan (http://denizstij.blogspot.com/)&lt;br /&gt;* Oct-2009&lt;br /&gt;*/&lt;br /&gt;public class CodeFormatter {&lt;br /&gt;private String CODESTYLE_FILE_REL_PATH="configs/CodeStyle.xml";&lt;br /&gt;private Map &amp;lt;String, String&amp;gt; codeStylesMap= new HashMap&amp;lt;String, String&amp;gt;();&lt;br /&gt;private static CodeFormatter instance = new CodeFormatter();&lt;br /&gt;private CodeFormatter() {&lt;br /&gt;}&lt;br /&gt;public static CodeFormatter getInstance() {&lt;br /&gt;     return instance;&lt;br /&gt;}&lt;br /&gt;public void populateCodeStyle() throws Exception{&lt;br /&gt;     codeStylesMap.clear();&lt;br /&gt;     InputStream is= CodeFormatter.class.getResourceAsStream(CODESTYLE_FILE_REL_PATH);&lt;br /&gt;     if (is==null){&lt;br /&gt;          return ;&lt;br /&gt;     }&lt;br /&gt;     // xmltool-3.0.jar from mycila needs to be class path&lt;br /&gt;     XMLTag from = XMLDoc.from(is, false);&lt;br /&gt;     if (from==null){&lt;br /&gt;          return;&lt;br /&gt;     }&lt;br /&gt;     XMLTag profileNode = from.gotoChild("profile");&lt;br /&gt;     Iterable&amp;lt;XMLTag&amp;gt; settings = profileNode.getChilds();&lt;br /&gt;     Iterator&amp;lt;XMLTag&amp;gt; iterator = settings.iterator();&lt;br /&gt;     while (iterator.hasNext()){&lt;br /&gt;          XMLTag next = iterator.next();&lt;br /&gt;          String id = next.getAttribute("id");&lt;br /&gt;          String value = next.getAttribute("value");&lt;br /&gt;          codeStylesMap.put(id, value);&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;public void applyCodeFormatter() throws Exception { &lt;br /&gt;     populateCodeStyle();&lt;br /&gt;     Hashtable options = JavaCore.getDefaultOptions();&lt;br /&gt;     Set&amp;lt;String&amp;gt; keySet = codeStylesMap.keySet();&lt;br /&gt;     for (String id:keySet){&lt;br /&gt;          String value= codeStylesMap.get(id);           &lt;br /&gt;          options.put(id, value);&lt;br /&gt;     }&lt;br /&gt;     JavaCore.setOptions(options);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;font-family:georgia;font-size:85%;"  &gt;&lt;br /&gt;Code Template&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;Similar to code style, code template can be applied by using &lt;span style="font-style: italic;"&gt;TemplateStore &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;TemplatePersistenceData &lt;/span&gt;classes&lt;span style="font-style: italic;"&gt;.  &lt;/span&gt;We can use &lt;span style="font-style: italic;"&gt;JavaPlugin.getDefault().getCodeTemplateStore()&lt;/span&gt; to obtain current &lt;span style="font-style: italic;"&gt;TemplateStore. &lt;/span&gt;Please note, these classes are in internal package, therefore, in further version of eclipse pde, it would cause issues (tested on eclipse 3.5)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; font-family: arial; font-size: 12px; width: 99%; height: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); text-align: left; line-height: 20px;"&gt;&lt;code style="color: rgb(0, 0, 0);"&gt; package com.denizstij.plugins.settings.codeformatter;&lt;br /&gt;import java.io.BufferedInputStream;&lt;br /&gt;import java.io.FileInputStream;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import org.eclipse.jdt.internal.ui.JavaPlugin;&lt;br /&gt;import org.eclipse.jface.text.templates.persistence.TemplatePersistenceData;&lt;br /&gt;import org.eclipse.jface.text.templates.persistence.TemplateReaderWriter;&lt;br /&gt;import org.eclipse.jface.text.templates.persistence.TemplateStore;&lt;br /&gt;/**&lt;br /&gt;* Programmatically apply code templates via eclipse pde&lt;br /&gt;*&lt;br /&gt;* @author deniz.turan (http://denizstij.blogspot.com/)&lt;br /&gt;* Oct-2009&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;public class CodeTemplate {&lt;br /&gt;  private String CODE_TEMPLATE_FILE_REL_PATH = "configs/CodeTemplate.xml";&lt;br /&gt;  private TemplatePersistenceData[] templateData;&lt;br /&gt;  private TemplateStore codeTemplateStore;&lt;br /&gt;  private static CodeTemplate instance = new CodeTemplate();&lt;br /&gt;  private CodeTemplate() {&lt;br /&gt;       init();&lt;br /&gt;  }&lt;br /&gt;  public static CodeTemplate getInstance() {&lt;br /&gt;       return instance;&lt;br /&gt;  }&lt;br /&gt;  public void applyCodeTemplates() throws Exception {&lt;br /&gt;       importCodeTemplate();&lt;br /&gt;  }&lt;br /&gt;  private void init() {&lt;br /&gt;       codeTemplateStore = JavaPlugin.getDefault().getCodeTemplateStore();&lt;br /&gt;       templateData = codeTemplateStore.getTemplateData(true);&lt;br /&gt;  }&lt;br /&gt;  private void importCodeTemplate() throws Exception {        &lt;br /&gt;       InputStream input = CodeTemplate.class.getResourceAsStream(CODE_TEMPLATE_FILE_REL_PATH) ;&lt;br /&gt;       if (input == null) {&lt;br /&gt;            return;&lt;br /&gt;       }&lt;br /&gt;       TemplateReaderWriter reader = new TemplateReaderWriter();&lt;br /&gt;       TemplatePersistenceData[] datas = reader.read(input, null);&lt;br /&gt;       for (int i = 0; i &amp;lt; datas.length; i++) {&lt;br /&gt;            updateTemplate(datas[i]);&lt;br /&gt;       }&lt;br /&gt;       codeTemplateStore.save();&lt;br /&gt;  }&lt;br /&gt;  private void updateTemplate(TemplatePersistenceData data) {&lt;br /&gt;       for (int i = 0; i &amp;lt; templateData.length; i++) {&lt;br /&gt;            String id = templateData[i].getId();&lt;br /&gt;            if (id != null &amp;amp;&amp;amp; id.equals(data.getId())) {&lt;br /&gt;                 templateData[i].setTemplate(data.getTemplate());&lt;br /&gt;                 break;&lt;br /&gt;            }&lt;br /&gt;       }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-2796312165702667066?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/2796312165702667066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=2796312165702667066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2796312165702667066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2796312165702667066'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/10/amending-code-style-templates.html' title='Amending Code Style &amp; Templates Programmatically via Eclipse PDE'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-8841181318051606017</id><published>2009-10-13T11:16:00.000-07:00</published><updated>2010-01-03T05:15:53.088-08:00</updated><title type='text'>Intrinsic Value of Shares</title><content type='html'>&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;Value Investing is a type of investing in which the trader buys shares in cheap price and sell them in higher price. Sure this is common feature of all tradings. But following differentiate it from other tradings:&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:lucida grande;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;It is based on fundamental of company rather than technical analysis &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;It is long term investing (more than 3 years)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;According to this trading paradigm, intrinsic value of a share is calculated based on fundamentals such as &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, P/E, Dividend, Dividend Payout Ratio, &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;-Growth 10 year.&lt;br /&gt;&lt;br /&gt;Since it is a long term investment, someone can wonder if a share's price is fair at a given time. In this text, i will explain a very simple technique to calculate intrinsic value of a share which is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;described&lt;/span&gt; in  &lt;a href="http://books.google.co.uk/books?id=VUFNjkdKLpYC&amp;amp;dq=getting+started+in+value+investing"&gt;Getting Started in Value Investing&lt;/a&gt; by Charles &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Mizrahi&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;. Please note that, this technique is more accurate on shares of which return on equity (ROE) in last 10 years is more than 15 and each year earning is increased around 10%. I will use &lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; Group &lt;a href="http://www.advfn.com/p.php?pid=financials&amp;amp;btn=s_ok&amp;amp;symbol=LSE%3Ahmv"&gt;(&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;LSE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.&lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/a&gt; share to explain the steps. Financial of HMV at point of writing this article is as follows:&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:lucida grande;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;Price (P):112.70p&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;:11.10p&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;PE:10.15&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;Dividend:5.6p&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Divident&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; Payout Ratio (&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;DPR&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;):66.67%&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;-Growth:20.65 % &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;1-) Estimate &lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_10" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; Growth (&lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_11" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_G) for the end of next five years.&lt;/span&gt;&lt;span style="font-size:0;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul  style="font-family:lucida grande;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;If average &lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_12" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; Growth is greater than 15% over the past 10 years, then we take &lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_13" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_G as 15%.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Otherwise use 10% as &lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_14" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_G&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;For &lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_15" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, even though &lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_16" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_G is around 20.65, i would like to take &lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_17" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_G as 10% for bad case scenario.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2-) Estimate P/E (PE_G) for the end of next five years&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:lucida grande;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;If average PE is above 20 over the past 10 years, then we take PE_G as 17&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Otherwise use 12 as PE_G&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:lucida grande;font-size:100%;"  &gt;For &lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_18" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, I would like to take PE_G as 10 for a more accurate estimate.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3-) Calculate &lt;span id="SPELLING_ERROR_19" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_19" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; by the end of 5 (N) years&lt;/span&gt;&lt;br /&gt;For this, we use simple interest rate equation :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_20" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_N= &lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_21" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;*((1+&lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_22" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;_G)^N)= 11.10*((1+0.10)^5)=17.88&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So by the end of 5 years, we expect &lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_23" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; will be 17.88 p&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4-) Calculate Price by the end of 5 (N) years:&lt;/span&gt;&lt;br /&gt;Since Price= PE*&lt;span id="SPELLING_ERROR_24" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_24" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;EPS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;, therefore:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;P_N=PE_G*EPS_N=10*17.88=178.8p;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;which is the price of &lt;span id="SPELLING_ERROR_25" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_25" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; share by the end of 5 years&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5-)Calculate dividends for next five years&lt;/span&gt;&lt;br /&gt;We project next five (N) years dividends by using past five years. We sum all dividends and then multiply it with Dividend Payout Ratio (&lt;span id="SPELLING_ERROR_26" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_26" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;DPR&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;D_N= &lt;span id="SPELLING_ERROR_27" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_27" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;DPR&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;*(d_n+d_n-1+d_n-2+d_n-3+.... d_N-1)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where d_n is the past year's dividend.&lt;br /&gt;So dividend of &lt;span id="SPELLING_ERROR_28" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_28" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; will be: D_5=0.6657*(5.6+7.4+7.4+7.4+6.9)=23.1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6-) Calculate Total Share&lt;/span&gt;&lt;br /&gt;Total share price is:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;T_N=P_N+D_N=178.8+23.1= 201.9p&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7-) Calculate Present value&lt;/span&gt;&lt;br /&gt;Based on a return rate (r) we calculate present value of T_N or in other words intrinsic value of share (IV):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;IV_N=TN*((1+r)^-N)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Let say, we would like to have 15 % return on our investment, then intrinsic value of &lt;span id="SPELLING_ERROR_29" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_29" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; is:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;IV=201.9*((1+0.15)^-5)= 100.3800.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At the moment price of &lt;span id="SPELLING_ERROR_30" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_30" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; is 112.70p. Therefore, we can conclude that &lt;span id="SPELLING_ERROR_31" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_31" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; is expensive according to its fundamental and return rate. We should wait &lt;span id="SPELLING_ERROR_32" class="blsp-spelling-error"&gt;&lt;span id="SPELLING_ERROR_32" class="blsp-spelling-error"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;HMV&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; price goes more down in order to make profitable long term investment.&lt;br /&gt;&lt;br /&gt;Please note this is a simple technique to judge if a share has a fair price at a time. There are other &lt;span id="SPELLING_ERROR_33" class="blsp-spelling-corrected"&gt;fundamental&lt;/span&gt; factors have to be analysed before using technique.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-8841181318051606017?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/8841181318051606017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=8841181318051606017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8841181318051606017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8841181318051606017'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/10/intrinsic-value-of-shares.html' title='Intrinsic Value of Shares'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-1690097530617232890</id><published>2009-10-10T02:20:00.000-07:00</published><updated>2009-10-13T11:16:14.583-07:00</updated><title type='text'>Eligible LSE Equities  for Share &amp;Stock ISA</title><content type='html'>I compiled a list of stocks traded on London Stock Exchange (LSE) which eligible for holding in a share &amp;amp; stock ISA. Please note, since HM Revenue publishes only a guideline for eligibility, some stocks in this would be not eligibible in some ISA management companes ( especially online brokers).&lt;br /&gt;&lt;br /&gt;Please click &lt;a href="http://denizstij.googlepages.com/stockISAListSort.xls"&gt;here &lt;/a&gt;to download the list which comprimes sector, epic, name,isin, currency and indices of the stocks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-1690097530617232890?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/1690097530617232890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=1690097530617232890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/1690097530617232890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/1690097530617232890'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/10/eligible-lse-equities-for-share-isa.html' title='Eligible LSE Equities  for Share &amp;Stock ISA'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-4324798926222291166</id><published>2009-09-27T11:43:00.000-07:00</published><updated>2009-09-27T13:11:15.755-07:00</updated><title type='text'>Best &amp; Worst Positions from Anthony Bolton's Portfolio/Funds</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;br /&gt;In my previous &lt;a href="http://denizstij.blogspot.com/2009/09/lessons-investing-against-tide-by.html"&gt;blog&lt;/a&gt;, i listed some advices from Anthony Bolton who worked as fund manager at London, Fidelity for decades. In this blog, i list some of his best and worst bets between 2000 and 2007.  I think, these example bets from his portfolio will be useful to understand dynamics of long term investments.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CUsers%5Cden%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CUsers%5Cden%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5Cden%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-GB&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi; 	mso-fareast-language:EN-US;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:595.3pt 841.9pt; 	margin:72.0pt 72.0pt 72.0pt 72.0pt; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-para-margin-top:0cm; 	mso-para-margin-right:0cm; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin;} table.MsoTableGrid 	{mso-style-name:"Table Grid"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-priority:59; 	mso-style-unhide:no; 	border:solid black 1.0pt; 	mso-border-themecolor:text1; 	mso-border-alt:solid black .5pt; 	mso-border-themecolor:text1; 	mso-padding-alt:0cm 5.4pt 0cm 5.4pt; 	mso-border-insideh:.5pt solid black; 	mso-border-insideh-themecolor:text1; 	mso-border-insidev:.5pt solid black; 	mso-border-insidev-themecolor:text1; 	mso-para-margin:0cm; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-fareast-language:EN-US;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; width: 462.1pt; margin-left: 36pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0" width="616"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid black; padding: 0cm 5.4pt; width: 154pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;Year&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;Best&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;Worst&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2000&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Autonomy&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Merrant&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Celltech&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British-Borne Oil&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Safeway&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Compel&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Johnson Matthey&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Scotia Holdings&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Ellis &amp;amp; Everard&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Albert Fisher&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Gallaher Group&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Allied Leisure&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Bank Of Ireland&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cookson Group&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Wembley&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Enodis&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Iceland Group&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Reed international &lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2001&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ICAP&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Railtrack&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;London Stock Exchange&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Carlton Communications&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Arcadia&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Iceland Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Inchcape&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Novar&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Balfour Beatty&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Enodis&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Safeway&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Elementis&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;George Wimpey&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;4 Imprint Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;De Beers&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SVB Holdings&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Gallaher&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British Airways&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Carillion&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Laird Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2002&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Credit Lyonnais&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Harmony Gold&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cable &amp;amp; Wireless&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Galleger Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SSL Intl&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Amlin&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Big Food Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Enterprise Oil&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Bulmer HP&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;MMO2&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cadiz Inc&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Bank of Ireland&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Royal &amp;amp; Sun Alliance&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SOCO international&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Carlton Communications&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;George Wimpey&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Oxford Glycosciences&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Kiln&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cookson Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2003&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cable &amp;amp; Wireless&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Goshawk Insurance&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Big Food group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SOCO Intl&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;WS Atkins&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Tullow Oil&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;NTL&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Kiln&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Carlton Communications&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Hiscox&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;William Hill&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Wellington U/W&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;MMO2&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Management Consultancy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Mothercare&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Beazley Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Somerfield&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;De la Rue&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Body Shop&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Tenon&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2004&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cairn Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ITV&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;MMO2&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Rank Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Celltech&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Proteome Sciences&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;London Stock Exchange&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BG Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Carlton Communications&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Big Food Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;First Calgary Peteroleum&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Aquarius Platinum&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Pendragon&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Royal &amp;amp; Sun Alliances&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Allied Irish Banks&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Reuters&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Orkla&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Shire&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Land Securities&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;NTL&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2005&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cairn Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;GCAP Media&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BG Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ITV&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Statoil&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;William Hill&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Amlin&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Marconi Corp&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;London Stock Exchange&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Roche&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;NTL&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Standard Chartered&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Provident Financial&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;C&amp;amp;C Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SMG&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;P&amp;amp;O Nedlloyd&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Minerva&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SOCO Intl&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Asia Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2006&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ITV&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Sportingbet&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Microfocus&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Isoft&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British Land&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Rank Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Mecom&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;GCAP Media&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Expro International&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BSkyB&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Shire&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Reed Elsevier&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BG Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Highland Gold&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Amlin&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;888 Holdings &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Astra Zeneca&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SMG&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Asia Energy&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td rowspan="10" style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2007&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Bayer&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Premier Foods&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BG Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Rank Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Electrcie de France&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;GCAP Media&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Nokia&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Premier Farnell&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Reuters&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SMG&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;J Sainsbury&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BP&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Reed Elsevier&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British Land&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Xansa&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Johnson Services Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Statoil Hydro&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Erinaceous Group&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Vodafone&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ITV&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;&lt;b style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;table class="MsoTableGrid" style="border: medium none ; width: 462.1pt; margin-left: 36pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0" width="616"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td rowspan="10" style="border: 1pt solid black; padding: 0cm 5.4pt; width: 154pt;" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: center; line-height: normal;" align="center"&gt;&lt;b style=""&gt;2000-2007&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Autonomy&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Sportingbet&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ICAP&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Rank Group&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Gallaher Group&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;ITV&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cairn Energy&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;GCAP Media&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;MMO2&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SMG&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Amlin&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Premier Foods&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Balfour Beatty&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Isoft&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;George Wimpey&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Cookson Group&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;BG Group&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;SSL Intl&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;Safeway&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 154.05pt;" valign="top" width="205"&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;British-Borneo Oil &amp;amp; Gas&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt; &lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-4324798926222291166?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/4324798926222291166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=4324798926222291166' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/4324798926222291166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/4324798926222291166'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/09/best-worst-positions-from-anthony.html' title='Best &amp; Worst Positions from Anthony Bolton&apos;s Portfolio/Funds'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-2764257446051176945</id><published>2009-09-14T14:10:00.000-07:00</published><updated>2009-09-14T14:51:12.118-07:00</updated><title type='text'>Pricing European Options by Black-Scholes Model</title><content type='html'>&lt;span style="font-size:85%;"&gt;In my previous blogs, price of european call and put options are estimated by &lt;a href="http://denizstij.blogspot.com/2009/08/pricing-european-options-with-monte.html"&gt;Monte Carlo Simulation&lt;/a&gt; and &lt;a href="http://denizstij.blogspot.com/2009/08/binomial-model-is-one-of-pricing-model.html"&gt;Binomial Model&lt;/a&gt;. In this blog, these options' prices are estimated by Black-Scholes (BS) model. BS model is more optimal pricing model than previous two methods. Actually, Monte Carlo simulation and Binomal model aims to approximate BS model.&lt;br /&gt;&lt;br /&gt;Price of european call and put options is estimated as follows by using BS model:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/Sq60LYP_9_I/AAAAAAAAAD4/7GHak8DEZz8/s1600-h/callPricing.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 362px; height: 211px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/Sq60LYP_9_I/AAAAAAAAAD4/7GHak8DEZz8/s400/callPricing.jpg" alt="" id="BLOGGER_PHOTO_ID_5381436712335439858" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/Sq60WXo-ZaI/AAAAAAAAAEA/hRzapxyFwps/s1600-h/putPricing.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 362px; height: 72px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/Sq60WXo-ZaI/AAAAAAAAAEA/hRzapxyFwps/s400/putPricing.jpg" alt="" id="BLOGGER_PHOTO_ID_5381436901150320034" border="0" /&gt;&lt;/a&gt;where&lt;br /&gt;S: Asset price&lt;br /&gt;E:Strike price&lt;br /&gt;D: Divident&lt;br /&gt;r:Interest Rate&lt;br /&gt;Sigma: Variance&lt;br /&gt;t:Current time&lt;br /&gt;T:Strike time&lt;br /&gt;N(x): Normal Cumulative Density Function&lt;br /&gt;&lt;br /&gt;Below sample C# and Matlab source code of Black-Scholes Model without any divident contribution is listed.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;1:  % Matlab Source Code  &lt;br /&gt;2:  % Estimatation of European Call and Put Option by Black-Scholes Model  &lt;br /&gt;3:  % denizstij (http://denizstij.blogspot.com/),  &lt;br /&gt;4:  % Sep,2009  &lt;br /&gt;5:  asset=230; %S  &lt;br /&gt;6:  strike=210;%X  &lt;br /&gt;7:  volatility=0.25; %sigma  &lt;br /&gt;8:  r=0.04545;  &lt;br /&gt;9:  time=0.5;  &lt;br /&gt;10:  d1=(log(asset/strike)+(r+(volatility^2)/2)*time)/volatility/(sqrt(time));  &lt;br /&gt;11:  %d2=(log(asset/strike)+(r-(volatility^2)/2)*time)/volatility/(sqrt(time));  &lt;br /&gt;12:  d2=d1-volatility*(sqrt(time))  &lt;br /&gt;13:  eu_call_option_price= asset*normcdf(d1,0,1)-strike*exp(-r*time)*normcdf(d2,0,1)  &lt;br /&gt;14:  eu_put_option_price= -asset*normcdf(-d1,0,1)+strike*exp(-r*time)*normcdf(-d2,0,1)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;1:  using System;  &lt;br /&gt;2:  using System.Collections.Generic;  &lt;br /&gt;3:  using System.Linq;  &lt;br /&gt;4:  using System.Text;  &lt;br /&gt;5:  using CenterSpace.Free;  &lt;br /&gt;6:  namespace Denizstij.Finance.Pricing.EuropeanOptionPricingByBlackScholes  &lt;br /&gt;7:  {  &lt;br /&gt;8:    /// &amp;lt;summary&amp;gt;  &lt;br /&gt;9:    /// Estimates European Call and Put options by using Black-Scholes model  &lt;br /&gt;10:    /// denizstij (http://denizstij.blogspot.com/)  &lt;br /&gt;11:    /// Sep-2009  &lt;br /&gt;12:    /// &amp;lt;/summary&amp;gt;  &lt;br /&gt;13:    class EuropeanOptionPricingByBlackScholes  &lt;br /&gt;14:    {  &lt;br /&gt;15:      // CenterSpace.Free.NormalDist to estimate normal cumulative density function  &lt;br /&gt;16:      // by CenterSpace Software (http://www.centerspace.net/resources.php)  &lt;br /&gt;17:      private NormalDist normDist = new NormalDist(0, 1);  &lt;br /&gt;18:      // Price estimator  &lt;br /&gt;19:      public List&amp;lt;double&amp;gt; estimatePrice(double asset, double strike, double volatility, double intRate, double time)  &lt;br /&gt;20:      {  &lt;br /&gt;21:        double d1 = (Math.Log(asset / strike) + (intRate + Math.Pow(volatility, 2) / 2) * time) / volatility / (Math.Sqrt(time));  &lt;br /&gt;22:        double d2 = d1 - volatility * (Math.Sqrt(time));  &lt;br /&gt;23:        double eu_call_option_price = asset * normDist.CDF(d1) - strike * Math.Exp(-intRate * time) * normDist.CDF(d2);  &lt;br /&gt;24:        double eu_put_option_price = -asset * normDist.CDF(-d1) + strike * Math.Exp(-intRate * time) * normDist.CDF(-d2);  &lt;br /&gt;25:        List&amp;lt;double&amp;gt; prices = new List&amp;lt;double&amp;gt;();  &lt;br /&gt;26:        prices.Add(eu_call_option_price);  &lt;br /&gt;27:        prices.Add(eu_put_option_price);  &lt;br /&gt;28:        return prices;  &lt;br /&gt;29:      }  &lt;br /&gt;30:      static void Main(string[] args)  &lt;br /&gt;31:      {  &lt;br /&gt;32:        EuropeanOptionPricingByBlackScholes pricing = new EuropeanOptionPricingByBlackScholes();  &lt;br /&gt;33:        List&amp;lt;double&amp;gt; prices = pricing.estimatePrice(230,  &lt;br /&gt;34:             210,  &lt;br /&gt;35:             0.25,  &lt;br /&gt;36:             0.04545,  &lt;br /&gt;37:             0.5 // In terms of years  &lt;br /&gt;38:          );  &lt;br /&gt;39:        System.Console.WriteLine("Call Option Price:" + prices.ElementAt(0)); // £30.741  &lt;br /&gt;40:        System.Console.WriteLine("Put Option Price:" + prices.ElementAt(1)); // £6.023  &lt;br /&gt;41:      }  &lt;br /&gt;42:    }  &lt;br /&gt;43:  }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-2764257446051176945?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/2764257446051176945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=2764257446051176945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2764257446051176945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2764257446051176945'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/09/pricing-european-options-by-black.html' title='Pricing European Options by Black-Scholes Model'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n3R9tfLFKTo/Sq60LYP_9_I/AAAAAAAAAD4/7GHak8DEZz8/s72-c/callPricing.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-5802741652893606120</id><published>2009-09-09T11:11:00.000-07:00</published><updated>2009-09-24T15:49:33.376-07:00</updated><title type='text'>Lessons -- Investing Against the Tide  by Anthony Bolton</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:85%;"&gt;Followings are lifelong lessons’ of Anthony Bolton who delivered record level return on investment funds at Fidelity for decades. These are elaborated in more detail in his latest book, “&lt;a href="http://www.amazon.co.uk/Investing-Against-Tide-Lessons-Running/dp/0273723766"&gt;Investing Against the Tide: Lessons from a Life Running Money&lt;/a&gt;”&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Companies&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Start by evaluating the quality of the finance&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Will it be here in ten years’ time and be more valuable?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Is the company in control of its own destiny?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Is the business model easy to understand?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Does the business generate cash?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Remember, mean reversion is one of the great truism of capitalism&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Beware company guidance &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Use part of a company meeting to talk about other companies&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;If you have any  doubt about a company, follow the cash&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;What to look for in management&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Integrity and openness are most important&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;If you have any question on company  or trustworthiness,  avoid  the company&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Do they have a detailed knowledge of the business strategically, operationally and financially?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Are the objectives and incentives of managements aligned with shareholders?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Do the management’s trades in the stock conflicts or confirm their statements?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Remember, people rarely change, invest in managers you trust&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Shares&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Every stock you own should have an investment thesis&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Test this regularly and if no longer valid sell&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Look at a share the same way as if you were buying the whole business at the price&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Forget the price you paid for shares&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Keep an open mind and know the ‘counter’ thesis&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Think in terms of levels of conviction rather than price targets&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Don’t try to make it back the way you lost it&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Consider six factors before you buy a share&lt;br /&gt;v    The quality of the business franchise&lt;br /&gt;v    The management&lt;br /&gt;v    The financials&lt;br /&gt;v    Technical analysis of the share price history&lt;br /&gt;v    The valuation against history&lt;br /&gt;v    Prospect for a takeover of the company&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Sentiment&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Rate perception as important as reality&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Successful investment is a blend of standing your own ground while listening to the market&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Short term, the stock market is a voting machine, rather than a weighting machine&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Sentiment extremes, regardless of the underlying attraction of  a share, can suggest major opportunity or risk. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Constructing a portfolio&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Position size should reflect conviction&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Don’t spend too much time on past performance attribution&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Your portfolio should as nearly as possible reflect a ‘start from scratch’ portfolio&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Don’t pay too much attention to index weights&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Make incremental rather than large moves&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Never become emotionally attached to a holding&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Investment is about making mistakes; win by not losing too often&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Sell if the investment thesis is broken, if a stock reaches your valuation target or if you find something better&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;If in doubt about a holding or a possible new holding compare it directly against the most comparative stock that you own.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Keep a balance between being on top of what you own and spending enough time looking for new ideas.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Risks &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;My biggest mistakes have nearly always been companies with poor balance sheet&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;One loses the most money on highly geared companies when business conditions deteriorate&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Remember that bad news doesn’t travel well&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Look at a share differently if it has performed well for several years; stocks with big unrealised profits in them are vulnerable in set backs&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Avoid ‘pass the parcel’ stocks – overvalued stocks with momentum -  where investors hope there is  more to go and they can sell them before the music stops&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Financials&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Always read a company’s announcements and information in the original – don’t rely  on a broker’s summary&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Carefully read the notes that accompany accounts – key information can be hidden in the notes&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Looking at valuations&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Don’t look at one valuation measure, especially just a PE multiple&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Buying cheap shares gives you a margin of safety&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Valuation anomalies are more likely in medium-sized and small companies&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Look at today’s valuation in the context of at least twenty-year historical valuations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Buying when valuations are low against history substantially increases your chance of making money&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Never forget absolute valuations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Remember that as a bull market progresses, valuation methods typically get less conservative and vice versa&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Takeovers and takeover targets&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Buy companies that have a M&amp;amp;A angle&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Big companies are less likely to be taken over&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The shareholder list can often carry clues about potential takeover candidates&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Be sceptical of being able to predict very short term M&amp;amp;A targets&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Favourite shares&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;At the heart if my approach is buying cheaply valued recovery shares&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Favour unpopular shares&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Does a targeted company have a new management team with a clear and detained recovery plan that you can track&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;You may have to buy a recovery stock before you have all the information&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Some of my best calls were in stocks that felt uncomfortable to buy&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Look for stocks with asymmetric pay-offs where you may make a lot of money but your downside is limited&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Value stocks outperform growth stocks in the long term&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;How to trade&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Delegate to a skilful trader and give them reasonable autonomy&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;I only set tight limits on a minority of my trades&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Know when to be aggressive and know when to let the market come to you&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Avoid giving round number limits – this is what most other portfolio managers do&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Be patient  - most stocks give you a second chance&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;A block is normally the cheapest way to deal in size&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Technical analysis&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The first thing I look at is the share chart&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Use technical analysis as a cross-check to your fundamental views&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Find an approach that works for you and then stick to it&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;More useful for larger stocks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Run profits and cut losses&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;Market timing&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Consistently successful market calls are very difficult to make&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;If you’re a private investor, take a long-term view. Don’t put money in the stock market that you will need in the next three years&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Never underestimate the fact that the market is an excellent discounter of the future&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Don’t be afraid to go against the general mode of the market&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Markets will react to expected positive or negative events in anticipation of those events.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Consider what is being assumed in share prices, rather than what the outlook is like&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;In the mature stages of a bull market, prune back your holdings of more risky stocks&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Be most on your guard after a long upward move of four to five years&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-5802741652893606120?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/5802741652893606120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=5802741652893606120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5802741652893606120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5802741652893606120'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/09/lessons-investing-against-tide-by.html' title='Lessons -- Investing Against the Tide  by Anthony Bolton'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-431624974170892017</id><published>2009-08-21T05:39:00.000-07:00</published><updated>2009-08-21T06:35:01.621-07:00</updated><title type='text'>Pricing European Options by using Monte Carlo Simulation</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;In my previous &lt;a href="http://denizstij.blogspot.com/2009/08/binomial-model-is-one-of-pricing-model.html"&gt;article&lt;/a&gt;, price of european option (put and call) is estimated by using binomial model  (Cox-Ross-Rubinstein (CRR) approach [&lt;a href="http://fedc.wiwi.hu-berlin.de/xplore/ebooks/html/sfe/sfenode36.html"&gt;1&lt;/a&gt;]). In this article, i  provide java and &lt;a href="http://www.scilab.org"&gt;Scilab &lt;/a&gt;(similar to Matlab) &lt;/span&gt;source code to estimate these option prices by Monte Carlo simulation.&lt;br /&gt;&lt;br /&gt;In binomial model, intrinsic value of an asset &lt;span style="font-style: italic;"&gt;(S_T)&lt;/span&gt; at expiry t&lt;/span&gt;&lt;span style="font-size:85%;"&gt;ime &lt;span style="font-style: italic;"&gt;(T)&lt;/span&gt; is estimated with a  sequence of discrete  time steps,  at each step, stock price is estimated with a probability (either &lt;span style="font-style: italic;"&gt;down&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;up&lt;/span&gt; probability. In monte carlo simulation, &lt;/span&gt;&lt;span style="font-size:85%;"&gt;intrinsic value of an asset &lt;span style="font-style: italic;"&gt;(S_T)&lt;/span&gt; at expiry time &lt;span style="font-style: italic;"&gt;(T) &lt;/span&gt; is obtained from a normal distribution such as [2]:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n3R9tfLFKTo/So6bOGti66I/AAAAAAAAADo/__f-LzihmTg/s1600-h/StockPriceByNormalDist.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 246px; height: 38px;" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/So6bOGti66I/AAAAAAAAADo/__f-LzihmTg/s400/StockPriceByNormalDist.JPG" alt="" id="BLOGGER_PHOTO_ID_5372402072121699234" border="0" /&gt;&lt;/a&gt;where, &lt;span style="font-style: italic;"&gt;r&lt;/span&gt; is annual interest rate &lt;span style="font-style: italic;"&gt;S_t&lt;/span&gt; asset price at time &lt;span style="font-style: italic;"&gt;t&lt;/span&gt; and sigma is volatility and &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; is normal distribution variable.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Having estimated &lt;span style="font-style: italic;"&gt;S_T&lt;/span&gt;, option's payoff can be estimated easily (&lt;span style="font-style: italic;"&gt;max (0, X-S_T)&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;max (0, S_T-X&lt;/span&gt;) for &lt;span style="font-style: italic;"&gt;call &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;put &lt;/span&gt;options respectively, where &lt;span style="font-style: italic;"&gt;X&lt;/span&gt; is options strike, exercise price).  Based on expected values of pay off functions which generated with monte carlo simulation, option prices can be calculated as follows for european call option:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/So6dy5thKUI/AAAAAAAAADw/PRzrHuvhzTA/s1600-h/PayOffByNormalDist.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 259px; height: 42px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/So6dy5thKUI/AAAAAAAAADw/PRzrHuvhzTA/s400/PayOffByNormalDist.JPG" alt="" id="BLOGGER_PHOTO_ID_5372404903310338370" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Source code of this estimation in java and &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;Scilab is listed&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; font-family: arial; font-size: 12px; width: 99%; height: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); text-align: left; line-height: 20px;"&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;1:  // SciLab (Matlab) Source code&lt;br /&gt;2:  // Estimate European Option price by Monte Carlo Simulation&lt;br /&gt;3:  // denizstij (http://denizstij.blogspot.com/),&lt;br /&gt;4:  // Aug-2009&lt;br /&gt;5:  asset=230; //S&lt;br /&gt;6:  strike=210;//X&lt;br /&gt;7:  volatility=0.25; //sigma&lt;br /&gt;8:  r=0.04545;&lt;br /&gt;9:  time=0.5;&lt;br /&gt;10:  num_sims=10000;&lt;br /&gt;11:  R= (r-0.5*volatility^2)*time;&lt;br /&gt;12:  SD=volatility*sqrt(time);&lt;br /&gt;13:  sum_call_payoffs=0.0;&lt;br /&gt;14:  sum_put_payoffs=0.0;&lt;br /&gt;15:  for i=0:num_sims,&lt;br /&gt;16:   S_T= asset*exp(R+SD*rand(1,'normal'));&lt;br /&gt;17:   sum_call_payoffs=sum_call_payoffs+max([0,S_T-strike]);&lt;br /&gt;18:   sum_put_payoffs=sum_put_payoffs+max([0,strike-S_T]);&lt;br /&gt;19:  end&lt;br /&gt;20:  eu_call_option_price= exp(-r*time)*(sum_call_payoffs/double(num_sims))&lt;br /&gt;21:  eu_put_option_price= exp(-r*time)*(sum_put_payoffs/double(num_sims))&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; font-family: arial; font-size: 12px; width: 99%; height: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); text-align: left; line-height: 20px;"&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;1:  package com.denizstij.finance.pricing;&lt;br /&gt;2:  import java.util.ArrayList;&lt;br /&gt;3:  import java.util.List;&lt;br /&gt;4:  import java.util.Random;&lt;br /&gt;5:  /**&lt;br /&gt;6:   *&lt;br /&gt;7:   * Estimate European Option price by Monte Carlo Simulation&lt;br /&gt;8:   * @author denizstij (http://denizstij.blogspot.com/)&lt;br /&gt;9:   * Aug-2009&lt;br /&gt;10:   *&lt;br /&gt;11:   */&lt;br /&gt;12:  public class EuropeanOptionPricingByMonteCarlo {&lt;br /&gt;13:       /**&lt;br /&gt;14:        * Estimate European Option price by Monte Carlo Simulation&lt;br /&gt;15:        *&lt;br /&gt;16:        * @param asset Current Asset Price&lt;br /&gt;17:        * @param strike Exercise Price&lt;br /&gt;18:        * @param volatility Annual volatility&lt;br /&gt;19:        * @param intRate Annual interest rate&lt;br /&gt;20:        * @param expiry: Time to maturity (in terms of year)&lt;br /&gt;21:        * @param num_sim : Number of simulations&lt;br /&gt;22:        * @return Put and call price of european options based on&lt;br /&gt;23:        *            Monte Carlo Simulation&lt;br /&gt;24:        */&lt;br /&gt;25:       public strictfp List&amp;lt;Double&amp;gt; estimatePrice(double asset,&lt;br /&gt;26:                 double strike,&lt;br /&gt;27:                 double volatility,&lt;br /&gt;28:                 double intRate,&lt;br /&gt;29:                 double time,&lt;br /&gt;30:                 int num_sim) {&lt;br /&gt;31:            List&amp;lt;Double&amp;gt; results = new ArrayList&amp;lt;Double&amp;gt;();&lt;br /&gt;32:            double R = (intRate - 0.5 *Math.pow(volatility,2))*time;&lt;br /&gt;33:            double SD = volatility * Math.sqrt(time);&lt;br /&gt;34:            double dF = Math.exp(-intRate*time); // discount Factor&lt;br /&gt;35:            double sumCallPayoffs=0.0;&lt;br /&gt;36:            double sumPutPayoffs=0.0;&lt;br /&gt;37:            Random random= new Random();&lt;br /&gt;38:            for (int i = 0; i &amp;lt;= num_sim; i++) {&lt;br /&gt;39:                 double nextGaussian = random.nextGaussian();&lt;br /&gt;40:                 double S_T= asset*Math.exp(R+SD*nextGaussian);&lt;br /&gt;41:                 sumCallPayoffs+=callPayOff(S_T,strike);&lt;br /&gt;42:                 sumPutPayoffs+=putPayOff(S_T,strike);&lt;br /&gt;43:            }&lt;br /&gt;44:            double callOptionPrices= dF*sumCallPayoffs/num_sim;&lt;br /&gt;45:            double putOptionPrices= dF*sumPutPayoffs/num_sim;&lt;br /&gt;46:            results.add(callOptionPrices);&lt;br /&gt;47:            results.add(putOptionPrices);&lt;br /&gt;48:            return results;&lt;br /&gt;49:       }&lt;br /&gt;50:       // Pay off method for put options&lt;br /&gt;51:       private double putPayOff(double stockPrice, double strike) {&lt;br /&gt;52:            return Math.max(strike - stockPrice, 0);&lt;br /&gt;53:       }&lt;br /&gt;54:       // Pay off method for call options&lt;br /&gt;55:       private double callPayOff(double stockPrice, double strike) {&lt;br /&gt;56:            return Math.max(stockPrice - strike, 0);&lt;br /&gt;57:       }&lt;br /&gt;58:       public static void main(String args[]) {&lt;br /&gt;59:            EuropeanOptionPricingByMonteCarlo euOptionPricing = new EuropeanOptionPricingByMonteCarlo();&lt;br /&gt;60:            List&amp;lt;Double&amp;gt; results = euOptionPricing.estimatePrice(&lt;br /&gt;61:                      230,&lt;br /&gt;62:                      210,&lt;br /&gt;63:                      0.25,&lt;br /&gt;64:                      0.04545,&lt;br /&gt;65:                      0.5, // In terms of year&lt;br /&gt;66:                      10000);&lt;br /&gt;67:            Double callOptionPrice = results.get(0);&lt;br /&gt;68:            Double putOptionPrice = results.get(1);&lt;br /&gt;69:            System.out.println("call Option Price:" + callOptionPrice);&lt;br /&gt;70:            System.out.println("put Option Price:" + putOptionPrice);&lt;br /&gt;71:       }&lt;br /&gt;72:  }&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-431624974170892017?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/431624974170892017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=431624974170892017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/431624974170892017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/431624974170892017'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/08/pricing-european-options-with-monte.html' title='Pricing European Options by using Monte Carlo Simulation'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n3R9tfLFKTo/So6bOGti66I/AAAAAAAAADo/__f-LzihmTg/s72-c/StockPriceByNormalDist.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-5884157742912229777</id><published>2009-08-19T07:54:00.000-07:00</published><updated>2009-08-21T06:32:55.828-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='algorithms'/><category scheme='http://www.blogger.com/atom/ns#' term='options'/><category scheme='http://www.blogger.com/atom/ns#' term='derivatives'/><category scheme='http://www.blogger.com/atom/ns#' term='pricing'/><category scheme='http://www.blogger.com/atom/ns#' term='source code'/><category scheme='http://www.blogger.com/atom/ns#' term='finance'/><title type='text'>Pricing European Options by using Binomial Model</title><content type='html'>&lt;span style="font-size:85%;"&gt;Binomial Model is one of the simplest pricing model for European options. Below you can find an implementation of Cox-Ross-Rubinstein (CRR) approach [&lt;a href="http://fedc.wiwi.hu-berlin.de/xplore/ebooks/html/sfe/sfenode36.html"&gt;1&lt;/a&gt;] in java for pricing of &lt;span style="font-style: italic;"&gt;put &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;call &lt;/span&gt;European options.&lt;br /&gt;&lt;br /&gt;With following parameters, sensitivity of the binomial pricing model as function of number of time steps can be seen in figure 1. With high number of time steps, binomial  model with CRR approach converges with optimal Black-Scholes formula (e.x: &lt;span style="font-style: italic;"&gt;30.741&lt;/span&gt; for call option)&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/SowjVdkUmgI/AAAAAAAAADg/HmwGjJkNuLM/s1600-h/stepsSensitivity.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 302px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/SowjVdkUmgI/AAAAAAAAADg/HmwGjJkNuLM/s400/stepsSensitivity.jpg" alt="" id="BLOGGER_PHOTO_ID_5371707307167357442" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Figure 1: Option price as a function of number of time steps.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="border: 1px dashed rgb(204, 204, 204); padding: 0px; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; overflow: auto; font-family: arial; font-size: 12px; width: 99%; height: auto; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: rgb(0, 0, 0); text-align: left; line-height: 20px;"&gt;&lt;code style="color: rgb(0, 0, 0);"&gt;1:  package com.denizstij.finance.pricing;&lt;br /&gt;2:&lt;br /&gt;3:  import java.util.ArrayList;&lt;br /&gt;4:  import java.util.List;&lt;br /&gt;5:&lt;br /&gt;6:  /**&lt;br /&gt;7:   *&lt;br /&gt;8:   * Estimate European Option price based on Cox, Ross and Rubinstein model&lt;br /&gt;9:   * @author denizstij (http://denizstij.blogspot.com/)&lt;br /&gt;10:   *&lt;br /&gt;11:   */&lt;br /&gt;12:  public strictfp class EuropeanOptionPricingByBinomial {&lt;br /&gt;13:&lt;br /&gt;14:       /**&lt;br /&gt;15:        * Estimate European Option price based on Cox, Ross and Rubinstein model&lt;br /&gt;16:        *&lt;br /&gt;17:        * @param asset Current Asset Price&lt;br /&gt;18:        * @param strike Exercise Price&lt;br /&gt;19:        * @param volatility Annual volatility&lt;br /&gt;20:        * @param intRate Annual interest rate&lt;br /&gt;21:        * @param expiry: Time to maturity (in terms of year)&lt;br /&gt;22:        * @param steps : Number of steps&lt;br /&gt;23:        * @return Put and call price of european options based on Cox, Ross and Rubinstein model&lt;br /&gt;24:        */&lt;br /&gt;25:       public List&amp;lt;Double&amp;gt; estimatePrice(double asset,&lt;br /&gt;26:                 double strike,&lt;br /&gt;27:                 double volatility,&lt;br /&gt;28:                 double intRate,&lt;br /&gt;29:                 double expiry,&lt;br /&gt;30:                 int steps) {&lt;br /&gt;31:            List&amp;lt;Double&amp;gt; results = new ArrayList&amp;lt;Double&amp;gt;();&lt;br /&gt;32:&lt;br /&gt;33:            List&amp;lt;Double&amp;gt; stockPrices = new ArrayList&amp;lt;Double&amp;gt;();&lt;br /&gt;34:            List&amp;lt;Double&amp;gt; callOptionPrices = new ArrayList&amp;lt;Double&amp;gt;();&lt;br /&gt;35:            List&amp;lt;Double&amp;gt; putOptionPrices = new ArrayList&amp;lt;Double&amp;gt;();&lt;br /&gt;36:&lt;br /&gt;37:            double time_step = (expiry) / steps;&lt;br /&gt;38:            double R = Math.exp(intRate * time_step);&lt;br /&gt;39:            double dF = 1 / R; // discount Factor&lt;br /&gt;40:&lt;br /&gt;41:            double u = Math.exp(volatility * Math.sqrt(time_step)); // up boundary&lt;br /&gt;42:            double d = 1 / u; // down boundary (Cox, Ross and Rubinstein constraint)&lt;br /&gt;43:            // at leaf node, price difference factor between each node&lt;br /&gt;44:            double uu = u * u; // (u*d)&lt;br /&gt;45:            double p_up = (R - d) / (u - d); // up probability&lt;br /&gt;46:            double p_down = 1 - p_up; // down probability&lt;br /&gt;47:&lt;br /&gt;48:            // initiliaze stock prices&lt;br /&gt;49:            for (int i = 0; i &amp;lt;= steps; i++) {&lt;br /&gt;50:                 stockPrices.add(i, 0.0d);&lt;br /&gt;51:            }&lt;br /&gt;52:&lt;br /&gt;53:            double sDown = asset * Math.pow(d, steps);&lt;br /&gt;54:            stockPrices.set(0, sDown);&lt;br /&gt;55:&lt;br /&gt;56:            // Estimate stock prices in leaf nodes&lt;br /&gt;57:            for (int i = 1; i &amp;lt;= steps; i++) {&lt;br /&gt;58:                 double sD = uu * stockPrices.get(i - 1);&lt;br /&gt;59:                 stockPrices.set(i, sD);&lt;br /&gt;60:            }&lt;br /&gt;61:&lt;br /&gt;62:            // estimate option's intrinsic values at leaf nodes&lt;br /&gt;63:            for (int i = 0; i &amp;lt;= steps; i++) {&lt;br /&gt;64:                 double callOptionPrice = callPayOff(stockPrices.get(i), strike);&lt;br /&gt;65:                 callOptionPrices.add(i, callOptionPrice);&lt;br /&gt;66:                 double putOptionPrice = putPayOff(stockPrices.get(i), strike);&lt;br /&gt;67:                 putOptionPrices.add(i, putOptionPrice);&lt;br /&gt;68:            }&lt;br /&gt;69:&lt;br /&gt;70:            // and lets estimate option prices&lt;br /&gt;71:            for (int i = steps; i &amp;gt; 0; i--) {&lt;br /&gt;72:                 for (int j = 0; j &amp;lt;= i - 1; j++) {&lt;br /&gt;73:                      double callV = dF*(p_up * callOptionPrices.get(j + 1) +&lt;br /&gt;74:                                p_down* callOptionPrices.get(j));&lt;br /&gt;75:                      callOptionPrices.set(j, callV);&lt;br /&gt;76:                      double putV = dF*(p_up * putOptionPrices.get(j + 1) +&lt;br /&gt;77:                                p_down * putOptionPrices.get(j));&lt;br /&gt;78:                      putOptionPrices.set(j, putV);&lt;br /&gt;79:                 }&lt;br /&gt;80:            }&lt;br /&gt;81:        &lt;br /&gt;82:            // first elements holds option's price&lt;br /&gt;83:            results.add(callOptionPrices.get(0));&lt;br /&gt;84:            results.add(putOptionPrices.get(0));&lt;br /&gt;85:            return results;&lt;br /&gt;86:       }&lt;br /&gt;87:&lt;br /&gt;88:       // Pay off method for put options&lt;br /&gt;89:       private double putPayOff(double stockPrice, double strike) {&lt;br /&gt;90:            return Math.max(strike - stockPrice, 0);&lt;br /&gt;91:       }&lt;br /&gt;92:&lt;br /&gt;93:       // Pay off method for call options&lt;br /&gt;94:       private double callPayOff(double stockPrice, double strike) {&lt;br /&gt;95:            return Math.max(stockPrice - strike, 0);&lt;br /&gt;96:       }&lt;br /&gt;97:   &lt;br /&gt;98:       public static void main(String args[]) {&lt;br /&gt;99:        &lt;br /&gt;100:            EuropeanOptionPricingByBinomial euOptionPricing = new EuropeanOptionPricingByBinomial();&lt;br /&gt;101:            List&amp;lt;Double&amp;gt; results = euOptionPricing.estimatePrice(&lt;br /&gt;102:                      230,&lt;br /&gt;103:                      210,&lt;br /&gt;104:                      0.25,&lt;br /&gt;105:                      0.04545,&lt;br /&gt;106:                      0.5, // In terms of year&lt;br /&gt;107:                      10);&lt;br /&gt;108:            Double callOptionPrice = results.get(0);&lt;br /&gt;109:            Double putOptionPrice = results.get(1);&lt;br /&gt;110:            System.out.println("call Option Price:" + callOptionPrice);&lt;br /&gt;111:            System.out.println("put Option Price:" + putOptionPrice);&lt;br /&gt;112:       }&lt;br /&gt;113:  }&lt;br /&gt;114:&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-5884157742912229777?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/5884157742912229777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=5884157742912229777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5884157742912229777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5884157742912229777'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/08/binomial-model-is-one-of-pricing-model.html' title='Pricing European Options by using Binomial Model'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_n3R9tfLFKTo/SowjVdkUmgI/AAAAAAAAADg/HmwGjJkNuLM/s72-c/stepsSensitivity.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-9219263914878070481</id><published>2009-08-11T14:10:00.000-07:00</published><updated>2009-08-11T15:20:08.015-07:00</updated><title type='text'>Volume Weighted Average Price (VWAP)</title><content type='html'>Recently i was skimming through an ebook about electronic trading (&lt;a href="http://www.amazon.com/Electronic-Algorithmic-Trading-Technology-Financial/dp/0123724910"&gt;Electronic and Algorithmic Trading Technology&lt;/a&gt;) after reading this news &lt;a href="http://blogs.wsj.com/marketbeat/2009/06/19/rise-of-the-market-machines/"&gt;article&lt;/a&gt;. This ebook outlines algorithmic trading in a concise way. According to this book and wikipedia &lt;a href="http://en.wikipedia.org/wiki/Algorithmic_trading"&gt;entry&lt;/a&gt;, more than half of the orders in London Stock Exchange in the last year were entered by algo traders.&lt;br /&gt;&lt;br /&gt;According to the ebook, one of the fundamental and basic algo trading is Volume Weighted Average Price (VWAP). VWAP is the ratio of value traded to total quantity of trades in a time period. It is average price of an security in terms of quantity. It is calculated as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5368831408499396946" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 53px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/SoHruIKREVI/AAAAAAAAADY/1EHyGAPiySk/s400/VWAP.jpg" border="0" /&gt;&lt;br /&gt;VWAP algorithm implies that at a given time if VWAP is greater than the price of share, then the share is under valued and it is a good candidate for buying. But if VWAP is lesser than the price of share, then it should be considered for selling. Even though, it is a very simple algorithm, it and its variations are commonly used in electronic trading.&lt;br /&gt;&lt;br /&gt;I have implemented a sample java application (algo trading) which estimates VWAP of an equity by fetching real time (15 min delayed) financial quotes from &lt;a href="http://uk.finance.yahoo.com/"&gt;Yahoo Finance, UK&lt;/a&gt;. Equity quotes (15 min delated) can be downloaded free of charge from yahoo finance pages in CSV format. The sample application periodically downloads predetermined quotes (for example VODAFONE GRP --VOD.L) in CSV format and estimates VWAP. Unfortonately, since downloaded data do not consists of trade quantity values (CSV files has following data: &lt;em&gt;symbol, mid trade, time, date, change, lowest trade, highest trade and volume&lt;/em&gt;), quantity value for each quote is estimated based on the &lt;em&gt;volume&lt;/em&gt; and &lt;em&gt;mid price.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;The sample application has multi layered architecture with observer design pattern. It uses Apache &lt;a href="http://hc.apache.org/httpclient-3.x"&gt;HTTPClient &lt;/a&gt;to download CVS files periodically from yahoo finance pages. After quotes are extracted from CSV files, they are appended to a linkedlist based time series and then observers (VWAP estimator and then VWAP clients(UI layer)) are notified for the latest updates.&lt;br /&gt;&lt;br /&gt;Click &lt;a href="http://denizstij.googlepages.com/VWAP-denizstij.zip"&gt;here &lt;/a&gt;to download source code of the sample application (algo trading) in java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-9219263914878070481?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/9219263914878070481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=9219263914878070481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/9219263914878070481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/9219263914878070481'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/08/volume-weighted-average-price-vwap.html' title='Volume Weighted Average Price (VWAP)'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n3R9tfLFKTo/SoHruIKREVI/AAAAAAAAADY/1EHyGAPiySk/s72-c/VWAP.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-6055583309393261231</id><published>2009-07-31T03:52:00.000-07:00</published><updated>2009-08-01T01:22:50.124-07:00</updated><title type='text'>Customized ClassPath Contributor- An Eclipse Plug-in</title><content type='html'>&lt;div  style="font-family:times new roman;"&gt;&lt;span style="font-size:100%;"&gt;When i first started using java (JDK 1.1),  classpath management was an issue for me. Setting up a classpath in command line and then running a java program was so error-prone. Luckily, IDE's, such such as eclipse and netbeans, make a developer's life is more happier.  Eclipse (actually eclipse framework) provides various functionalities for fast, productive, efficent, and happy programming, not just for Java, but also man&lt;/span&gt;&lt;span style="font-size:100%;"&gt;y other langues (C/C++, Php, Flex, ...)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Classpath management for java in eclipse , of course, is more ease&lt;/span&gt;&lt;span style="font-size:100%;"&gt;r than bare command line.  But it still lacks of some functionalities.  Profile based shared repository is one of these missing functionalities. So often in my current work, in eclipse, i find myself arranging classpaths after SVN branching or merging or changing workspace or checking out from SVN. My personal settings during these operations conflicts with other developers settings.  There is not any profile (indiviual) based mechanism for settings and classpat&lt;/span&gt;&lt;span style="font-size:100%;"&gt;h ( I am awera that maven provides profile and central reposisty based but our projects has legacy ant scripts)&lt;br /&gt;&lt;br /&gt;Therefore, We decided to create a central setting project (&lt;span style="font-style: italic;"&gt;Settings&lt;/span&gt;) wh&lt;/span&gt;&lt;span style="font-size:100%;"&gt;ich contributes automatically and independently to our projects (for example, &lt;span style="font-style: italic;"&gt;Beee &lt;/span&gt;&amp;amp; &lt;span style="font-style: italic;"&gt;Booo&lt;/span&gt;)  based on developer's profiles. Figure 1 depicts a sample workspace which contains two sample projects (&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;Beee &lt;/span&gt;&amp;amp; &lt;span style="font-style: italic;"&gt;Booo&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;) and a setting project &lt;/span&gt;&lt;span style="font-size:100%;"&gt; (&lt;span style="font-style: italic;"&gt;Settings&lt;/span&gt;)  which contains profiles (&lt;span style="font-style: italic;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;Settings&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/profiles&lt;/span&gt;) and central shared libraries (&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;Settings&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/libs&lt;/span&gt;)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/SnL82xp1wNI/AAAAAAAAACg/GGLP6P-ybu4/s1600-h/ProjectView.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 176px; height: 400px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/SnL82xp1wNI/AAAAAAAAACg/GGLP6P-ybu4/s400/ProjectView.JPG" alt="" id="BLOGGER_PHOTO_ID_5364628124123644114" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Figure 1: Settings projects and Sample projects (Beee &amp;amp; Booo ) in workspace&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Let me talk a bit about &lt;span style="font-style: italic;"&gt;Settings &lt;/span&gt;project. Setting project is a  centralized configuration project and holds shared and indivual settings and libraries for each developer. Therefore, structure of the settings project would vary. But a setting project has following main directories:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Settings/&lt;b&gt;libs&lt;/b&gt;: Contains common, share libraries&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Settings/&lt;b&gt;profiles&lt;/b&gt;: Holds indivual profiles.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;Each profile (ex: &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;deniz.turan&lt;/span&gt;&lt;span style="font-size:100%;"&gt;) directory under  "&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;Settings/profiles&lt;/span&gt;&lt;span style="font-size:100%;"&gt;" directory holds developer specific settings. Name of profiles directories are same as user's system (windows or linux) login names in order to discover automaticly profiles for developer.   &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Each profile has following subdirectories which would have specific or custom sub directories (such ants, libs)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Settings/profiles/deniz.turan/&lt;b&gt;ants:&lt;/b&gt;  Holds ant script related indivual properties and custom build scrtips: There are two important file here:               &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Settings/profiles/deniz.turan/&lt;b&gt;libs&lt;/b&gt;:   Holds profile based libraries. User can create sub library directories (with prefiex "lib_", ex: lib_1, lib_2, lib_3 ....)  to arrange class path orders.  Library class path order is natural order of String Class such as : lib_1 &gt;lib_2&gt; lib_3&gt; ... &gt; Settings/profiles/deniz.turan/libs (See figure 4 and 5)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;     &lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;em&gt;Imprtant note: Profiles' libraries are in higher order in class path as demonstrated in below&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;Having a central setting project is not enough alone, unless the content of profiles (&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;Settings&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/profiles&lt;/span&gt;) and central common libraries (&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;Settings&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;/libs&lt;/span&gt;) are &lt;/span&gt;&lt;span style="font-size:100%;"&gt;automatically contributed to main projects for each developer independently. Therefore, i decided to develop an eclipse plug-in to contribute to classpath of a project from a setting project and profile, with a automatic manner. Of course, it is possible to add libraries or folders to project's build path in eclipse, but as i pointed out above, it causes conflicts during merges, branches or in new workspace or on other machines.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;To develop plug-in, following two extension points from eclipse rcp framework are used:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;org.eclipse.jdt.core.classpathContainerInitializer&lt;/span&gt; : Initialize and manage class path container (ex:&lt;span style="font-style: italic;"&gt; "Deniz's Classpath"&lt;/span&gt;, in sample source project, Figure 2 , 4 and 5)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;org.eclipse.jdt.ui.classpathContainerPage : Configuration page for classpath container (Figure 3)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;For an overview of JDT in eclipse, please click &lt;a href="http://www.eclipsecon.org/2008/sub/attachments/JDT_fundamentals.ppt"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Below you can see some screen shots from Classpath Manager project and a sample workspace.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_n3R9tfLFKTo/SnMBo46GRZI/AAAAAAAAACo/8F10K2ZJlpA/s1600-h/AddLibrary.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 354px;" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/SnMBo46GRZI/AAAAAAAAACo/8F10K2ZJlpA/s400/AddLibrary.JPG" alt="" id="BLOGGER_PHOTO_ID_5364633383110854034" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;Figure 2: Classpath Container ("&lt;span style="font-style: italic;"&gt;Deniz's Classpath Manager"&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_n3R9tfLFKTo/SnMD7VFlZtI/AAAAAAAAACw/zBnMVhqBOZQ/s1600-h/ProfileSelection.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 364px;" src="http://4.bp.blogspot.com/_n3R9tfLFKTo/SnMD7VFlZtI/AAAAAAAAACw/zBnMVhqBOZQ/s400/ProfileSelection.JPG" alt="" id="BLOGGER_PHOTO_ID_5364635898936125138" border="0" /&gt;&lt;/a&gt; &lt;span style="font-size:85%;"&gt;Figure 3: Classpath Container Page &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_n3R9tfLFKTo/SnMFh1lM3NI/AAAAAAAAADA/NxlbXeY7eqI/s1600-h/Libraries.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://1.bp.blogspot.com/_n3R9tfLFKTo/SnMFh1lM3NI/AAAAAAAAADA/NxlbXeY7eqI/s400/Libraries.JPG" alt="" id="BLOGGER_PHOTO_ID_5364637660005326034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Figure 4: After Classpath Manager contributes to a project's build path &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_n3R9tfLFKTo/SnMF2IYUseI/AAAAAAAAADI/FQ3AqoBVbsg/s1600-h/ProjectView2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 227px; height: 400px;" src="http://2.bp.blogspot.com/_n3R9tfLFKTo/SnMF2IYUseI/AAAAAAAAADI/FQ3AqoBVbsg/s400/ProjectView2.JPG" alt="" id="BLOGGER_PHOTO_ID_5364638008648970722" border="0" /&gt;&lt;/a&gt; &lt;span style="font-size:85%;"&gt;Figure 5: Final workspace after Classpath Manager contributes &lt;/span&gt;resources from Settings project and profile (deniz.turan)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:100%;"&gt;As figure 5 illustrates, content of &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;deniz.turan&lt;/span&gt;&lt;span style="font-size:100%;"&gt; profile in Settings project (&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;/Settings/profiles/deniz.turan&lt;/span&gt;&lt;span style="font-size:100%;"&gt;) and common libraries (&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;/Settings/libs&lt;/span&gt;&lt;span style="font-size:100%;"&gt;) are contributed to sample "&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;Booo&lt;/span&gt;&lt;span style="font-size:100%;"&gt;" project. As explained above, order of contributed libraries in classpath are based on first profile sub libraries (&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;/Settings/profiles/deniz.turan/libs/lib_1&lt;/span&gt;&lt;span style="font-size:100%;"&gt;),  and then profiles libraray (&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;/Settings/profile/deniz.turan/libs&lt;/span&gt;&lt;span style="font-size:100%;"&gt;) and finally common libraries &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;(/Settings/libs&lt;/span&gt;&lt;span style="font-size:100%;"&gt;)&lt;br /&gt;&lt;br /&gt;You can &lt;a href="http://denizstij.googlepages.com/Denizstij_ClassPathManager.zip"&gt;download  &lt;/a&gt;source code of Classpath Manager eclipse plugin project with  sample setting project.  The source code is a prototype and implements basic idea of the classpathContainerInitializer and classpathContainerPage extensions.  It is tested with eclipse 3.4 and 3.5.&lt;br /&gt;&lt;br /&gt;Click &lt;a href="http://denizstij.googlepages.com/Denizstij_ClassPathManager.zip"&gt;here&lt;/a&gt; to download ource code.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-6055583309393261231?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/6055583309393261231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=6055583309393261231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/6055583309393261231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/6055583309393261231'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/07/customized-classpath-contributor.html' title='Customized ClassPath Contributor- An Eclipse Plug-in'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_n3R9tfLFKTo/SnL82xp1wNI/AAAAAAAAACg/GGLP6P-ybu4/s72-c/ProjectView.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-382467223980545111</id><published>2009-07-25T00:42:00.000-07:00</published><updated>2009-09-15T04:37:29.942-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='finance'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Fooled by Randomness, Nassim Nicholas Taleb</title><content type='html'>&lt;span class="Apple-style-span" style="font-size: small;"&gt;Think a book, whose author offends, mocks and bores its readers while he pretends he is the most clever, smart, intellectual and scientific guy in the world in each page of the book. It is not only written in a chaotic structure-- chapters, sections are not related to each other or very mixed up in terms of concepts and structure, the author also uses lots of buzzwords, redundant and wrong examples.&lt;br /&gt;&lt;br /&gt;I am talking about &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;"&lt;/span&gt;&lt;a href="http://www.amazon.co.uk/Fooled-Randomness-Hidden-Chance-Markets/dp/0141031484"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Fooled by Randomness, The hidden Role of Chance in Life and in the Market&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;"&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, by &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Nassim&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; Nicholas &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. Have a look at following quote from the book:&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;"What has more value? (a) a contract that pays you $1 million if the stock market goes down 10% on any given day in the next year; (b)a contract that pays you $1 million if the stock market goes down 10% on any given day in the next year due to a terrorist act. " &lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;What is your answer? a or b ? &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; claims:&lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;"I expect most people to select (b)." &lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;I am not sure IQ level of people around &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, but i reckon, most people would go option a. (I know that, in a normal distrubuted financial world, %10 changes in stock market is so low probability -- once every 73 to 603 trillion billion years-- , but in last 80 years, that incident happened over 2 times and five sigma deviation is over 73 times, which happens once in 7000 years if finance data is normally distrubuted.  More info is &lt;a href="http://www.eurointelligence.com/article.581+M5f21b8d26a3.0.html"&gt;here&lt;/a&gt;). &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; is a trader and scholar, works in a fixed income (bonds) financial company. He has background in science (PhD) and like many other PhD graduate, he bored in academia after some time and started to work in finance sector. In his book, he claims that probability theory is not a natural or trivial concepts for many people to comprehend. I do agree with him in this claim. But he takes his claims further and try to establish a theory and life style based on randomness (rare events) . He claims that he is expert on random events and he takes advantages of these random events in his life and business. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;He exemplifies his ideas with "fictitious" characters who works as traders in finance (fixed income or equity markets). These characters are generally quite extreme and opposite of each other. For example, he kicks off the book with stock and bond market traders. The stock market trader, Steve, does not have any sound education and a risk taker and get successful so quickly. On the other hand, the bond market trader, Bob, has a degree in probability and he does not take much risk in his business (to be honest, there is not much risk in fixed income market compare to stock market). Because of calculated and not risk taking style, Bob is not rich as much as Steve. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; claims that the success of the stock market trader, Steve, is based on randomness, in another words just &lt;/span&gt;&lt;em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;"luck"&lt;/span&gt;&lt;/em&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. He claims that even if you put 10.000 monkeys in stock market as trader, and monkeys trade randomly, by the end of 5 years, there will be at least a rich monkey. He also claims that after some lengthy time (10 years), all of these monkeys will disappear (The clever one would run away when he has some money, but most of them lose all of their money before they are kicked out). &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; has a point in analogy, i think. Similar to many aspect of life, randomness also has a part in stock market. But i think, his claims that without proper analysis, research and hard work in stock market, someone would get rich randomly is just &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_7"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;ridiculous&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. He &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;dismisses&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; that the &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;participant&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; of stock markets are intelligent, agile and very adaptive people. Stock market has chaotic aspects, but not totally random. It responses a deterministic way to some events (for example, if a small company merges or bought by a big company, it's share will surge). And the job of traders is to predict (or to speculate) these events in order to make profit. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;I found many so-called scientific or intellectual ideas of &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Talebs&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, especially in probability theory is very mixed up. For example, he ignores the main reason of filters in statistics or engineering (filtering &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;outliners&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; and noise). While he claims that he takes advantages of these &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;outliners&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; (randomness, noise) in his real life and business, he complaints about the source of the noise for example, media and journalist (He has issue with media, &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;TV&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, papers too). He contradicts himself, and gives mixed messages in different part of the book. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;In brief, in his book, &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Taleb&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; comes cross as an arrogant, geek person who claims 'if you disagree with me, you're an idiot and I will ignore and laugh at you.' He wrote the book for just sake of writing a book, and before clearing and organising the ideas in his mind. His writing style and personality kills the some of his nice ideas. By the end of book, i felt big disappointment. It was worst ever book i read in a long time. &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_15"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Luckily&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, the current book in my hand ("&lt;/span&gt;&lt;a href="http://www.amazon.co.uk/Ascent-Money-Financial-History-World/dp/1846141060"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;The Ascent of Money: A Financial History of the World&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;") , is making me to forget yucky taste of this book.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-382467223980545111?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/382467223980545111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=382467223980545111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/382467223980545111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/382467223980545111'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/07/fooled-by-randomness-nassim-nicholas.html' title='Fooled by Randomness, Nassim Nicholas Taleb'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-8481004751953504959</id><published>2009-07-18T08:56:00.000-07:00</published><updated>2009-07-31T05:59:17.797-07:00</updated><title type='text'>Better Annotation in Java Around a Testing Framework</title><content type='html'>Recently in a pet project, i got involved extensively with annotation in java. I wanted to create a testing framework in which unit tests are created based on given methods level annotations. The testing concept is similar to &lt;a href="http://easymock.org/"&gt;EasyMock&lt;/a&gt;, but rather than creating mock objects, i wanted to capture real objects during "runtime" and then create tests cases based on annotation and output/input parameters. By the way, with "Runtime" i don't mean production environment. When a QA or developer run (tests) the product, tests cases and its inputs are created and stored.&lt;br /&gt;&lt;br /&gt;After clearing the concept in my mind, i decided to do a prototype. In the first prototype, i wanted to implement &lt;span style="font-style: italic;"&gt;@AssertNotNull&lt;/span&gt; unit test case for method's input parameters and output value.&lt;br /&gt;&lt;br /&gt;By deploying method level java byte code injection with &lt;a href="http://www.csg.is.titech.ac.jp/%7Echiba/javassist/"&gt;javassist &lt;/a&gt;and a simple annotation (&lt;span style="font-style: italic;"&gt;@AssertNotNull&lt;/span&gt;), unit tests are create for methods and inputs and outputs of methods are serialized. Once i catch the input objects (parameters of the method) with injected byte code at the beginning and end of methods, i serialized them in XML format with &lt;a href="http://xstream.codehaus.org/"&gt;XStream&lt;/a&gt; . Injected byte codes also call a TestGenerator service to generate unit tests based on the defined annotation and serialized input/outputs. In unit test phrase, I was planning to deserialize these input objects and uses as input to automatically created tests. First prototype was successful. Unit tests (&lt;span style="font-style: italic;"&gt;@AssertNotNull)&lt;/span&gt; are created for output object and input parameters of a given annotated method. It was a big step to create unit tests automatically with real object rather than mock objects like &lt;a href="http://easymock.org/"&gt;EasyMock&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As a next step, i decided to implement a prototype for more complex test cases which has two inputs, for example @&lt;span style="font-style: italic;"&gt;AssertEquals&lt;/span&gt;. When i was prototyping @&lt;span style="font-style: italic;"&gt;AssertEquals&lt;/span&gt; annotation, i noticed that annotation in java are really so basic. They do not provide so much functionalities for advance usage such as:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Hierarchy&lt;/span&gt;: One of the main concept in OO is missing in annotation creation.You are not allowed to extend an annotation. For example, i would like to create a base annotation type (let say @Test) and many sub annotation types (@AssertTrue, @AssertNotNull, @AssertEquals) which extend @Tests. This approach, Hierarchy in annotation, would save lots of computation and coding time if reflection is used to probe which methods are annotated with a type of annotation (@Test) rather than a specific annotation (@AssertTrue). Of course, as a solution to lack of Hierarchy in annotation, methods or classes can be annotated both with super type and specific type annotation (both for example, &lt;span style="font-style: italic;"&gt;@AssertNotNull&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;@Test&lt;/span&gt;). But isn't it an ugly code ?&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Multiple annotation:&lt;/span&gt; A method or class can be annotated only once with a specific annotation. Even it is not much common in real life, as in my test framework, it should be possible to annotate a method with different parameters. For example, i would like to annotate a method with multiple &lt;span style="font-style: italic;"&gt;@AssertNotEqual&lt;/span&gt; each of which uses different parameters. People who comes cross that issue, generally creates a container annotation For example in JPA, If you would like to annotate an entity with multiple &lt;span style="font-style: italic;"&gt;@NamedQuery&lt;/span&gt;, you have to declare these annotations in &lt;span style="font-style: italic;"&gt;@NamedQueries&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Simple Type&lt;/span&gt; : Types of fields in annotation are so restricted. Only &lt;span style="font-style: italic;"&gt;primitive&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;String &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;Class &lt;/span&gt;types are allowed.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;I think annotation in java should be revised. &lt;span style="font-style: italic;"&gt;Similar to enums&lt;/span&gt; they should to be enhanced for a versatile and advanced usage. I am aware that these issues can be resolved with some other ways as i mentioned above, and it is not trivial to implement comprehensive annotation, but i still think that java deserves better annotation design.&lt;br /&gt;&lt;br /&gt;By the way, i am still working on this pet project, test framework! Once i finished it, i will create a blog here with more detail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-8481004751953504959?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/8481004751953504959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=8481004751953504959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8481004751953504959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8481004751953504959'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/07/better-annotation-in-java.html' title='Better Annotation in Java Around a Testing Framework'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-4795395789175910211</id><published>2009-05-07T06:06:00.000-07:00</published><updated>2009-05-07T06:44:33.172-07:00</updated><title type='text'>JNDI &amp; EclipseLink in GWT 1.6.x</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;br /&gt;New version of GWT (1.6.x) comes with a new embedded web server, Jetty, rather than Tomcat. When GWT team was determining 1.6 milestone, they started this issue to discussion &lt;a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/604aec6b7460c133?hl=en&amp;amp;pli=1"&gt;(here)&lt;/a&gt; Finally, cons and pro's of Jetty overcome Tomcat, and GWT 1.6 is shipped with a new embedded web server.&lt;br /&gt;&lt;br /&gt;Among other sturctural changes, this change cause some issues. JNDI issue is one of them. In our legacy project we were using Tomcat and our JNDI settings was defined in context.xml. With a new jetty server, JNDI settings  has to be defined in web-jetty.xml. But there is a undocumented (actually misdocumented) point, which should be kept in mind.  When defining JNDI variable in jetty-web.xml, you should use full qualified name, unlike in Tomcat.&lt;br /&gt;&lt;br /&gt;For example, in our old legacy code,  Tomcat setting for our data source was defined as : &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;jdbc/SybaseIQ&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. But jetty expect full path such as:  (&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;java:comp/env/jdbc/SybaseIQ)&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. Please note but you still need to use shorter name &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt; jdbc/SybaseIQ&lt;/span&gt;&lt;span style="font-size:85%;"&gt; in your code or persistence.xml.&lt;br /&gt;Otherwise you would get &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;"javax.naming.NameNotFoundException"&lt;/span&gt;&lt;span style="font-size:85%;"&gt; exception and even lost yourself in complex advises from discussion &lt;a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3f5369b0aea1a265"&gt;groups&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another point should be kept in mind, if you use another JPA implementation rather than Datanucleus, which comes with Google Application Engine, when you create your GWT project, do not select Google Application Engine option.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-4795395789175910211?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/4795395789175910211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=4795395789175910211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/4795395789175910211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/4795395789175910211'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/05/jndi-eclipselink-in-gwt-16x.html' title='JNDI &amp; EclipseLink in GWT 1.6.x'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-8790002769221919252</id><published>2009-04-03T03:38:00.000-07:00</published><updated>2009-06-11T00:34:10.446-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Symbian'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse plug-in development'/><category scheme='http://www.blogger.com/atom/ns#' term='CDT'/><category scheme='http://www.blogger.com/atom/ns#' term='Hover Help Plug-in'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbide c++'/><title type='text'>Hover Help (HH) Plug-in for Carbide c++ v2.0</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Those of you, who use &lt;/span&gt;&lt;a href="http://www.eclipse.org/"&gt;&lt;span style="font-size:85%;"&gt;Eclipse&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; IDE for development, know how much Eclipse IDE makes coding easier for  developers. Among many other functionality, Eclipse IDE provides refactoring, skeleton project creation, automatic building, easy launching, template source generation, code completion and various and quickest way to access help contents. For example, by hovering mouse over an API or pressing F2 key on a keyword, javadoc of the keyword/API can be displayed in a pop-up browser in java source editors. In my last work, as an eclipse plug-in developer at &lt;/span&gt;&lt;a href="http://www.symbian.org/"&gt;&lt;span style="font-size:85%;"&gt;Symbian&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;/Nokia, London, I participated in a project to develop a plug-in for similar help functionality for &lt;/span&gt;&lt;a href="http://www.forum.nokia.com/Resources_and_Information/Tools/IDEs/Carbide.c++/"&gt;&lt;span style="font-size:85%;"&gt;Carbide c++&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;. &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;There are many open source products and IDE based on Eclipse framework. &lt;/span&gt;&lt;a href="http://www.forum.nokia.com/Resources_and_Information/Tools/IDEs/Carbide.c++/"&gt;&lt;span style="font-size:85%;"&gt;Carbide c++ &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;from Nokia is one of them. &lt;em&gt;“Carbide.c++ is a family of IDEs for the creation of C++ and C applications for Symbian OS devices. Carbide.c++ is based on the Eclipse IDE and the C/C++ development tools from the Eclipse CDT Project.”&lt;/em&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;Upon several open source mobile framework such as Google's Andriod and Apple's iPhone, last year Nokia decided to go open source too and acquired Symbian in Dec, 2008 and set up &lt;a href="http://www.symbian.org/"&gt;Symbian Foundation&lt;/a&gt;. By the end of this month (April, 2009), Symbian Foundation will kick off. &lt;/span&gt;&lt;span style="font-size:85%;"&gt;One of the biggest task at Symbian nowadays is to prepare Symbian SDK to open source community. A good and easy accessible documentation is one of these tasks. My role in Symbian as eclipse plug-in developer was to prepare a Carbide c++ plug-in (Hover Help plug-in) to provide Symbian OS API documentation seamlessly in a c++ editor, similar to Javadoc display functionality in eclipse with F2 key or hovering by mouse.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div align="justify"&gt;Below you can find an overview of Hover Help plug-in. It is extracted from help of the HH plug-in. In this text, i wont go in technical details. But if you need more technical information (such as CDT, API binding, plug-ins, hover extension points, direct access to jar content without extracting), please contact me via email. &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Hover Help (HH) &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;The Hover Help Plug-in is an Eclipse plug-in that provides a link between the Carbide IDE and the C++ Developer Library. When installed, it provides developers with easy access to the API reference documentation. When a user hovers over a C++ API, the editor shows the documentation for this API reference. &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5320460515569572738" style="margin: 0px auto 10px; display: block; width: 563px; height: 263px; text-align: center;" alt="" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/SdYSpmAEG4I/AAAAAAAAACI/bTMsge8SP4w/s400/Browser_Console_NewL_API.JPG" border="0" /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The Hover Help Plug-in uses the The Developer Library Plug-in. This is an Eclipse documentation plug-in that contains the information displayed when an API reference item is hovered over.&lt;br /&gt;You can download the Developer Library Plug-in from the &lt;/span&gt;&lt;a href="http://symbianfoundation.org/"&gt;&lt;span style="font-size:85%;"&gt;Symbian Foundation&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; website. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Prerequisites for installation &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;The following software package is required for the Developer Library Hover Help Plug-in to work: &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Carbide 2.0 Note: The Hover Plug-in does not work with Carbide 1.3. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Hover Help Plug-in Dependencies: com.nokia.carbide.cpp.sysdoc.hover.dependencies &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Hover Help Plug-in version 1.0 or higher: com.nokia.carbide.cpp.sysdoc.hover&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;You must also you have installed the other programs that are required to do Symbian OS C++ development in Carbide, such as Active Perl and an SDK. Refer to the readme documentation of Carbide for further information. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Installing the Hover Help Plug-in &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;You can install the Hover Help Plug-in in the same way as other Eclipse plug-ins: &lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Place the Hover Help Plug-in and its dependency plug-in into Carbide’s plugins directory. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Restart Carbide. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Set Up &lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;This section describes the initial set up of the Hover Help Plug-in and how you can add the Developer Library plug-in. &lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;After installation &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;p align="justify"&gt;After installation of all the components, the Hover Help Plug-in prepares itself for its first use by reading of the interchange file (hover_help.xml). &lt;/p&gt;&lt;p align="justify"&gt;This process will take a few seconds and progress is displayed in Progress view. &lt;/p&gt;&lt;p align="justify"&gt;You can cancel the indexing process, the hover help plug-in will be deactivated. You can re-activate the hover help plug-in using &lt;/p&gt;&lt;/span&gt;&lt;a title="This section describes the preferences panel that you can use to configure and change the Developer Library Plug-ins used by the Hover Help Plug-in." href="http://127.0.0.1:2360/help/ntopic/com.nokia.carbide.cpp.sysdoc.hover/resources/help%20context/dl_hover/html/preferences.html#hover%2eprefs%2e"&gt;&lt;span style="font-size:85%;"&gt;the preference panel&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;, the indexing will start again. &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;p align="justify"&gt;&lt;strong&gt;Adding a new Developer Library Plug-in &lt;/strong&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;/p&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;New versions of the Developer Library Plug-in are published regularly. You can configure the Hover Help Plug-in to use a new version as follows: &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;p&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;Obtain the latest Developer Library Plug-in from the &lt;a href="http://symbianfoundation.org/"&gt;&lt;span style="font-size:85%;"&gt;Symbian Foundation&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; website, and copy the new plug-in into Carbide’s plugins directory. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Restart Carbide. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;From Developer Library Hover Help Preference panel, make sure new added Developer library is selected. If not select it from plug-in drop-down box. &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Activating the Hover Help Plug-in &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;If the Hover Help Plug-in has been de-activated, you can activate it by following the steps: &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;Go to the &lt;span style="font-size:85%;"&gt;Developer Library Hover Help Preferences&lt;/span&gt;&lt;span style="font-size:85%;"&gt; and un-check the check box deactivate the plug-in. When you reactivate the Hover Help Plug-in, the plug-in will initialise to &lt;/span&gt;&lt;span style="font-size:85%;"&gt;"Automatically select latest Developer Library"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. See &lt;/span&gt;&lt;span style="font-size:85%;"&gt;automatically select the latest Developer Library&lt;/span&gt;&lt;span style="font-size:85%;"&gt; for more information &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;Select the plug-in from the Developer Libraries Help Files plug-in drop-down box.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Hover Help Preferences &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;This section describes the preferences panel that you can use to configure and change the Developer Library Plug-ins used by the Hover Help Plug-in. &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5320461463671157586" style="margin: 0px auto 10px; display: block; width: 448px; height: 252px; text-align: center;" alt="" src="http://2.bp.blogspot.com/_n3R9tfLFKTo/SdYTgx9GM1I/AAAAAAAAACQ/mW23SRgDQ-g/s400/PreferencePage-2.JPG" border="0" /&gt;&lt;br /&gt;With the preference panel I can: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Let the Hover Help plug-in automatically choose for me the right Developer Library Plug-in. &lt;/li&gt;&lt;li&gt;Select a Developer Library plug-in using the drop-down box. &lt;/li&gt;&lt;li&gt;Deactivate the Hover Help plug-in. &lt;/li&gt;&lt;li&gt;Restore the plug-in configuration to default. &lt;/li&gt;&lt;li&gt;Apply, confirm or cancel the changes. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Automatically select the Developer Library plug-in &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;When you check the check box "Automatically select the latest Developer Library" the Developer Library is automatically selected for you. The name of the selected library is displayed in the greyed field. &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;If you want to select a particular Developer Library Plug-in, you can uncheck the checkbox "Automatically select latest Developer Library". &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;The right Developer library is chosen using the following heuristic. To be noted that the items are ordered by importance. &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Audience and license of the Developer Library. The choice is between platform and public development. For example: "DL for platform" will be chosen rather then "DL for public" &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Publication date of the Developer Library For example: "DL published 15/02/2009" will be chosen rather then "DL published 01/01/2009" &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;p&gt;&lt;strong&gt;Select a Developer Library &lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;The selected Developer Library is shown in the drop-down box.&lt;br /&gt;To be able to change the Developer Library, the &lt;/span&gt;&lt;span style="font-size:85%;"&gt;"Automatically select latest Developer Library"&lt;/span&gt;&lt;span style="font-size:85%;"&gt; checkbox should not be checked. To change the active Developer Library, select the Developer Library Help Plug-ins drop-down box. &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Deactivate Hovering check box &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;The Deactivate Hovering check box enables or disables the hovering feature in the Eclipse IDE.&lt;br /&gt;When you reactivate the Hover Help plug-in, the plug-in is set to &lt;/span&gt;&lt;span style="font-size:85%;"&gt;"Automatically select latest Developer Library"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Apply, confirm, cancel &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;These buttons have the common Carbide behaviour.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Defaults &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;If “Restore Default” button is clicked, the plug-in will automatic reset to &lt;/span&gt;&lt;span style="font-size:85%;"&gt;"Automatically select latest Developer Library"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-8790002769221919252?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/8790002769221919252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=8790002769221919252' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8790002769221919252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8790002769221919252'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/04/hover-help-hh-plug-in-for-carbide-c-v20.html' title='Hover Help (HH) Plug-in for Carbide c++ v2.0'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n3R9tfLFKTo/SdYSpmAEG4I/AAAAAAAAACI/bTMsge8SP4w/s72-c/Browser_Console_NewL_API.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-5941317037055040713</id><published>2009-02-18T02:40:00.000-08:00</published><updated>2009-08-11T15:24:21.207-07:00</updated><title type='text'>King Rat by James Clavell</title><content type='html'>&lt;span style="font-size:85%;"&gt;I am one of those guys who can not read any book any time. My mind set has to be in right mood to read a book. Otherwise how many times i start a book, i can not finish it. But once my mind set is right, i may finish a book in a day. I remember very well many times i tried to read &lt;/span&gt;&lt;a href="http://www.amazon.com/New-Life-Orhan-Pamuk/dp/0375701710"&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;The New Life&lt;/em&gt; &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;by Orhan Pamuk and could not finish it, when it is first published . Whenever i opened the book, after 5-10 pages, i could not read further. I used to find myself lost among pages, sentences. But couple of years later, i finished it in a day, when my mind set was ready for it. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Fate of a book, &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/King_Rat_%281962_novel%29"&gt;&lt;span style="font-size:85%;"&gt;King Rat&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt; by James Clavell was not much different than &lt;em&gt;The New Life &lt;/em&gt;until last week. I felt a bit guilty not reading it becuase it was a gift from my girl friend. But whenever i opened it, i could not go more than a couple of pages, even though i saw its movie version. With its blue cover, it was on my book shelf for a long time, until my hungar to reading a non-technical text surged again. (I was not reading any novel, non-technical text last couple of months, due to busy work and mind set). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;But last time, it was different. Once i started reading it, i could not stop myself. I did enjoy every pages, every word of it. Its affect on me was comparable to one of my favourite book, &lt;em&gt;The Grapes of Wrath &lt;/em&gt;by John Steinbeck. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;This book is based on a real life story of British pilot, Peter Marlowe, who surrendered to Japanese soldiers in WW II and his time with fellow English speaking people (American, British, Austrilian) as POW in a Japanese camp in Singapore. To survive in the camp with ethic and integrity against hunger, disease and primitive human and society rules and needs is the subject of the book. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;I strongly advise this book to anybody who would like to meet real characters with their basic needs in tough circumstances. This book is a mirror to human nature and society. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-5941317037055040713?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/5941317037055040713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=5941317037055040713' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5941317037055040713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5941317037055040713'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2009/02/king-rat-by-james-clavell.html' title='King Rat by James Clavell'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-7288561868924858341</id><published>2008-10-17T04:09:00.000-07:00</published><updated>2010-06-02T02:22:05.498-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java/j2ee'/><title type='text'>PI approximation with  Monte Carlo Simulation</title><content type='html'>&lt;pre  style="BACKGROUND: #ffffff;color:#000000;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3f5fbf;"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; PI approximation using  Monte Carlo Simulation. Draw a square of&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; unit area on the ground&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; then inscribe a circle within it. Now&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; scatter some&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; small objects (for example&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; grains of rice or sand) throughout the square. If&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; the objects are scattered uniformly&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; then the proportion of objects within&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; the circle vs objects within the square should be approximately PI&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;/&lt;/span&gt;&lt;span style="color:#008c00;"&gt;4&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; which&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; is the ratio of the circle's area to the square's area. Thus&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; if we count the&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; number of objects in the circle&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; multiply by four&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; and divide by the total&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; number of objects in the square (including those in the circle)&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;,&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; we get an&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; approximation to PI. (&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Monte_Carlo_method)"&gt;http://en.wikipedia.org/wiki/Monte_Carlo_method)&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#7f9fbf;"&gt;*&lt;/span&gt;&lt;span style="color:#3f5fbf;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3f5fbf;"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;public&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;class&lt;/span&gt; PiEstimationWithMonteCarlo &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;public&lt;/span&gt; &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; estimatePI&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#bb7977;"&gt;long&lt;/span&gt; numberSample&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#bb7977;"&gt;long&lt;/span&gt; numberInCircle &lt;span style="color:#808030;"&gt;=&lt;/span&gt; &lt;span style="color:#008c00;"&gt;0&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; pi &lt;span style="color:#808030;"&gt;=&lt;/span&gt; &lt;span style="color:#008000;"&gt;0.0&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;for&lt;/span&gt; &lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#bb7977;"&gt;int&lt;/span&gt; i &lt;span style="color:#808030;"&gt;=&lt;/span&gt; &lt;span style="color:#008c00;"&gt;0&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt; i &lt;span style="color:#808030;"&gt;&amp;lt;&lt;/span&gt; numberSample&lt;span style="color:#800080;"&gt;;&lt;/span&gt; i&lt;span style="color:#808030;"&gt;+&lt;/span&gt;&lt;span style="color:#808030;"&gt;+&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;         &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; x &lt;span style="color:#808030;"&gt;=&lt;/span&gt; generateRandomNumber&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; y &lt;span style="color:#808030;"&gt;=&lt;/span&gt; generateRandomNumber&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;if&lt;/span&gt; &lt;span style="color:#808030;"&gt;(&lt;/span&gt;insideCircle&lt;span style="color:#808030;"&gt;(&lt;/span&gt;x&lt;span style="color:#808030;"&gt;,&lt;/span&gt; y&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;br /&gt;             numberInCircle&lt;span style="color:#808030;"&gt;+&lt;/span&gt;&lt;span style="color:#808030;"&gt;+&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;     pi &lt;span style="color:#808030;"&gt;=&lt;/span&gt; &lt;span style="color:#808030;"&gt;(&lt;/span&gt;numberInCircle &lt;span style="color:#808030;"&gt;*&lt;/span&gt; &lt;span style="color:#008c00;"&gt;4&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#808030;"&gt;/&lt;/span&gt; &lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#bb7977;"&gt;double&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; numberSample&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;return&lt;/span&gt; pi&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;private&lt;/span&gt; &lt;span style="color:#bb7977;"&gt;boolean&lt;/span&gt; insideCircle&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; x&lt;span style="color:#808030;"&gt;,&lt;/span&gt; &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; y&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; distance &lt;span style="color:#808030;"&gt;=&lt;/span&gt; x &lt;span style="color:#808030;"&gt;*&lt;/span&gt; x &lt;span style="color:#808030;"&gt;+&lt;/span&gt; y &lt;span style="color:#808030;"&gt;*&lt;/span&gt; y&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;if&lt;/span&gt; &lt;span style="color:#808030;"&gt;(&lt;/span&gt;distance &lt;span style="color:#808030;"&gt;&gt;&lt;/span&gt; &lt;span style="color:#008c00;"&gt;1&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;         &lt;span style="color:#696969;"&gt;// out of circle&lt;/span&gt;&lt;br /&gt;         &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;return&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;false&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;     &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;return&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;true&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;private&lt;/span&gt; &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; generateRandomNumber&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#696969;"&gt;// between -1 and 1&lt;/span&gt;&lt;br /&gt;     &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;return&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#bb7977;"&gt;Math&lt;/span&gt;&lt;span style="color:#808030;"&gt;.&lt;/span&gt;random&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#808030;"&gt;*&lt;/span&gt; &lt;span style="color:#008c00;"&gt;2&lt;/span&gt; &lt;span style="color:#808030;"&gt;-&lt;/span&gt; &lt;span style="color:#008c00;"&gt;1&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;public&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;static&lt;/span&gt; &lt;span style="color:#bb7977;"&gt;void&lt;/span&gt; main&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold;color:#bb7977;"&gt;String&lt;/span&gt; args&lt;span style="color:#808030;"&gt;[&lt;/span&gt;&lt;span style="color:#808030;"&gt;]&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt; &lt;span style="color:#800080;"&gt;{&lt;/span&gt;&lt;br /&gt;     PiEstimationWithMonteCarlo piEstimator &lt;span style="color:#808030;"&gt;=&lt;/span&gt; &lt;span style="FONT-WEIGHT: bold;color:#800000;"&gt;new&lt;/span&gt; PiEstimationWithMonteCarlo&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color:#bb7977;"&gt;double&lt;/span&gt; pi &lt;span style="color:#808030;"&gt;=&lt;/span&gt; piEstimator&lt;span style="color:#808030;"&gt;.&lt;/span&gt;estimatePI&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#008c00;"&gt;5000000&lt;/span&gt;&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="FONT-WEIGHT: bold;color:#bb7977;"&gt;System&lt;/span&gt;&lt;span style="color:#808030;"&gt;.&lt;/span&gt;out&lt;span style="color:#808030;"&gt;.&lt;/span&gt;println&lt;span style="color:#808030;"&gt;(&lt;/span&gt;&lt;span style="color:#0000e6;"&gt;"PI="&lt;/span&gt; &lt;span style="color:#808030;"&gt;+&lt;/span&gt; pi&lt;span style="color:#808030;"&gt;)&lt;/span&gt;&lt;span style="color:#800080;"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800080;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-7288561868924858341?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/7288561868924858341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=7288561868924858341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/7288561868924858341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/7288561868924858341'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/10/pi-approximation-with-monte-carlo.html' title='PI approximation with  Monte Carlo Simulation'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-2766824858848860748</id><published>2008-10-14T05:06:00.000-07:00</published><updated>2008-10-17T05:35:05.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Bets and the City: Sally Nicoll's Spread Betting Diary</title><content type='html'>&lt;span style="font-size:85%;"&gt;One of my friend started to work in a leading spread betting company recently. It was the first time i heard spread betting. It came cross to me as gambling at first but my friend tried to convince me that it is trading more than betting and many trader uses it to hedge their investment.&lt;br /&gt;&lt;br /&gt;With these are in my mind, i bought a spread &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;betting and&lt;/span&gt; a stock market books to get some beginner information about this sector. Let me be clear first, i &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;don't&lt;/span&gt; like gambling, i never heard or seen anybody gains from gambling, apart from &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;casino&lt;/span&gt; or gambling saloon owners. Besides, i saw from some of people around me how gambling dramatically effects people's life.&lt;br /&gt;&lt;br /&gt;Spread betting book i purchased is &lt;/span&gt;&lt;a href="http://www.amazon.co.uk/Bets-City-Nicolls-Spread-Betting/dp/1905641060"&gt;&lt;span style="font-size:85%;"&gt;Bets and the City: Sally &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Nicoll's&lt;/span&gt; Spread Betting Diary&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;. It has good review rate on Amazon and i think it is a good book to get some starting information on learning phrase of a spread better or gambler.&lt;br /&gt;&lt;br /&gt;Nothing can explain this book more than "Bridget Jones meets Wall Street", i think. As a middle age, single lady with tendency to gambling, Sally decides to play on spread betting after reading an article on a magazine. She is also a full-time writer, struggling to finish her first novel. While she learns and gamble rather than trade on spread betting, she writes her spread betting experience or dairies on a spread betting company's website.&lt;br /&gt;&lt;br /&gt;She puts together a genuine dairy. In her blog/dairy, she writes all her mistakes, losses, gains and lessons with a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;hilarious&lt;/span&gt; way with her daily life. Like many beginner, she is not much successful, in many trades she loses, but each time she strikes back with new methodologies. And she explains in a clean way her mistakes, as much as she can.&lt;br /&gt;&lt;br /&gt;When she published her spread betting dairy as book, after a year, she was still a learner and not millionaire yet. She does not reveal her final account figures in the end of the book, but i think, she lost big chunk of her initial money. But she still claims that spread betting (especially binary betting) is a trade &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_6"&gt;rather&lt;/span&gt; than a gambling, which i doubt very much, especially in this financial crisis (even in normal conditions, in the medium and long term). Maybe Sally should try also arbitrage sport betting which a friend of mine claims that he earned decent amount with his pocket money when he was in university. When i heard these, i can not help myself thinking motto of BBC3's The Real Hustle TV program: "These bets are very tempting to take part in but you can guess which way the bet always goes - the hustler's way!"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-2766824858848860748?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/2766824858848860748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=2766824858848860748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2766824858848860748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/2766824858848860748'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/10/bets-and-city-by-sally-nicolls-spread.html' title='Bets and the City: Sally Nicoll&apos;s Spread Betting Diary'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-6118213513579428756</id><published>2008-10-01T09:22:00.000-07:00</published><updated>2008-10-17T05:36:02.328-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java/j2ee'/><title type='text'>Sample Address Book</title><content type='html'>Here is a sample address book application based on 3-tier architecture and with various frameworks and toolkits such as :&lt;br /&gt;&lt;br /&gt;Presentation layer &lt;a href="http://3.bp.blogspot.com/_n3R9tfLFKTo/SOPP2te_caI/AAAAAAAAAA0/MttpSrVQdU4/s1600-h/addContact.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5252270129273598370" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 396px; CURSOR: hand; HEIGHT: 214px" height="265" alt="" src="http://3.bp.blogspot.com/_n3R9tfLFKTo/SOPP2te_caI/AAAAAAAAAA0/MttpSrVQdU4/s320/addContact.JPG" width="320" border="0" /&gt;&lt;/a&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;GWT &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;EXT GXT&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Logic layer &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Spring &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Hibernate&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Database layer &lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;HSQLDB (or MySQL) &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Source code as eclipse project is available &lt;a href="http://denizstij.googlepages.com/simpleaddressbook.zip"&gt;here&lt;/a&gt; . Please note, in order to run project in eclipse, a maven 2 plugin must be installed. I suggest m2eclipse (&lt;a href="http://m2eclipse.codehaus.org/"&gt;http://m2eclipse.codehaus.org/&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Requirements&lt;/strong&gt; for the address books are as follows: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;A simple address book with three separate pages.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;The first page&lt;/strong&gt; should allow the user to input up to 50 names and phone numbers at a time. The user can input between one and fifty name/numbers at a time.Each name must be unique and have only one phone number.Both the name and the phone number must not be blank.The names and phone numbers should be stored in memory. Phone numbers should be validated to contain only numbers, with an optional + prefix and possibly one pair of brackets with at least one number in them. The phone number must start either with a + or a 0 - if it starts with a +, it cannot be followed by a 0.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;The second page&lt;/strong&gt; should list all stored numbers and names, sorted alphabetically. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;The third page&lt;/strong&gt; should allow a user to search the address book by phone number (exact number, not substrings) and also by full name or part of a name (case insensitive). It should display all matching names and related phone numbers for the search criteria.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-6118213513579428756?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/6118213513579428756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=6118213513579428756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/6118213513579428756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/6118213513579428756'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/10/sample-address-book.html' title='Sample Address Book'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_n3R9tfLFKTo/SOPP2te_caI/AAAAAAAAAA0/MttpSrVQdU4/s72-c/addContact.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-242418090731329131</id><published>2008-09-06T10:04:00.001-07:00</published><updated>2008-10-17T05:37:37.466-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='announcements'/><title type='text'>Spring in Finance eXchange</title><content type='html'>There is a full day free event SPRING IN FINANCE EXCHANGE on 10-10-08 by Spring Source. It seems interesting. Click &lt;a href="http://skillsmatter.com/event/cloud-grid/spring-in-finance-exchange-166"&gt;here &lt;/a&gt; see the programme and register before it is too late.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-242418090731329131?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/242418090731329131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=242418090731329131' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/242418090731329131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/242418090731329131'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/09/spring-in-finance-exchange.html' title='Spring in Finance eXchange'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-264882764269919841</id><published>2008-09-06T09:59:00.000-07:00</published><updated>2008-10-14T14:45:19.232-07:00</updated><title type='text'>Patterns of Enterprise Application Architecture by Martin Fowler</title><content type='html'>&lt;span style="font-size:85%;"&gt;In this text, I will share my thoughts and some of the important points from Martin Fowler's book &lt;/span&gt;&lt;a href="http://books.google.co.uk/books?id=FyWZt5DdvFkC"&gt;&lt;span style="font-size:85%;"&gt;Patterns of Enterprise Application Architecture&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;. Similar to some of my other texts, this is an ongoing text, i will try to update it regularly while i read the book.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Enterprise Applications&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Followings are the important aspects of an Enterprise Applications:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Persistent Data&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Huge Volume of Data&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Concurrent Access to Data and Resources&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Multiple User Interfaces&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Integration with other Enterprise Applications&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Same data with various syntax and semantics format&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Complex Business Logic/Illogic&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;In the light of these, we can say that, for example, following applications are not of enterprise applications: web browser, word/image /video processor, games, OS, compilers, digital TV software... And followings can be given as examples to enterprise applications: " ... payroll, patient records, shipping tracking, cost analysis, credit scoring, insurance, supply chain, accounting, customer service, and foreign exchange tradin."&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Performance of an Enterprise Application is one of the vital factor in its success. Following has to be kept in mind during design in terms of performance:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Response Time:&lt;/em&gt; Amount of time it takes to process an request&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Responsiveness: &lt;/em&gt;How quick the system acknowledge back that a request is received. Generall, responsiveness is more shorter than response time.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Latency:&lt;/em&gt; Minimum time to get a response from a remote system for a given existing or non existing task or request. Remote calls tends to increase latency therefore they should kept minimum.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Throughput: &lt;/em&gt;The amount of work/task done in a given time. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Load:&lt;/em&gt; How much system is under stress due to concurrent requests on a time point.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Load Sensetivity: &lt;/em&gt;Under a specific &lt;em&gt;load&lt;/em&gt; or stress quickness of response time&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Efficiency:&lt;/em&gt; Performance (response or throughput) per by resource&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Capacity:&lt;/em&gt; Maximum effective load or throughput of a sytem&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Scability:&lt;/em&gt; How performance is affected if resources are added or removed. Especially, hardware resources must be kept in mind when considering scability.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;In terms of performance, the ultimate target in enterprise applications is to maximize the throughput or minimizing the repsonse time. Obviously, there is a trade-off between throughput and response time, therefore, ratio between throughput and response time has to be decided based on the constraints and requirements of application domain. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Chapter 1- Layering&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Layering is one of the fundemantal pattern in enterprise applications. Layering is representing an application with loose coupled and highly coherent components, each of which sits on top of a lower components. Each layer only aware of the lower layer and it provides an interface to communicate with upper layers. Layering provides: &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Abstraction:&lt;/em&gt; Each layer is responsible of a set of task and does not has to know detail implementation of other layers&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Substitute:&lt;/em&gt; Without effecting much other layers, a layer's implementation can be changed. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Minimize dependencies&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Standardization:&lt;/em&gt; By providing interface each layer make some sort of de-facto standardization, contract for other layers.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Reusability:&lt;/em&gt; Layer can be used with other high level layers.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;On the other hand, extra layering would &lt;/span&gt;&lt;span style="font-size:85%;"&gt;degrade performance since in each layer data or inputs has to be transferred into the layer specific format. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;The Three Principal Layers&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;There are three principle layers:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Presentation:&lt;/em&gt; Displaying or providing information to user. Generally sits on client side&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Domain:&lt;/em&gt; Business logic which generally sits on server side.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Data Source :&lt;/em&gt; Communication with database, messaging system, transaction again generally on server side. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:130%;"&gt;Chapter 2. Organizing Domain Logic&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Three separated pattern to organize domain logic:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Transaction Script&lt;/em&gt;: Based on simple procedural approach&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Domain Model:&lt;/em&gt; Based on Object Oriented modelling&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Table Module:&lt;/em&gt; Hybrid of transaction and domain model&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;A common approach is to put a &lt;em&gt;Service Layer&lt;/em&gt; on top of above patterns in domain logic. A service layer provides clear API and placeholds for transaction control and security. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Chapter 3. Mapping to Relational Databases&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;This chapter elaborates mapping patterns and issues between domain layer and datasource layer such as architectural, behavioral, structural, decorative, connections and schemas. &lt;/span&gt;&lt;span style="font-size:85%;"&gt;Fortunately, many of these concerns and patterns are implemented and addressed with latest OMR frameworks (such as hibernate) unless if you dont want to create your own OMR layer or framework. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Chapter 4. Web Presentation&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Most important aspect in Web presentation is separation of business logic from web presentation by using patterns similar to MVC (Model, View, &lt;em&gt;Input&lt;/em&gt; Controller). In case of a web application, MVC works as follows:&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;A request comes to controller which extract required information from the request.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Controller forwards it to business logic for an appropriate model object&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;The model object fetch persistent data via data access objects and aggregate/format data for response object&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Returns to controller to decide which view will be used to display the response.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Controller passes the response data to the view&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;View is prepared and return back to client&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Separating model from presentation is also a good practice in terms of testing. Each section, especially business model, can be tested independently without dealing with presentation issues. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;View Patterns&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Transform View: Similar to XSLT, it deploys a transformation schema which applied to inputs.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Template View: With structured page which has embed markers indicating where dynamic content to go. Server page technologies such as ASP, PHP, JSP implement this pattern. While this pattern provides a flexible and powerful coding, unfortunately, it also leads to a messy presentation code. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;In addition to these patterns, view is generated either with a &lt;em&gt;single step(stage)&lt;/em&gt; or &lt;em&gt;two step view.&lt;/em&gt; In single step view generation, there is a one view module for each user interface, display and presentation decisions are taken only in this module. But in two step view, each view module responsible of a specific view and then this view is passed to second stage where global, common view is created. This is a vital advantage of two step view cos of it provides highly coherent view modules. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Input Controller Patterns&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Input controller handles HTTP request and analyse it and then decide what to do with the request. There are two patterns for input controller :&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Page Controller: For every page there is a input controller which create models and process it and then create a view object and returns it. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Front Controller: A centralized single object intercepts all requests and upon analyse them, it creates separate handlers to process each request.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Chapter 5. Concurrency&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Concurrency Issues&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Lost Updates&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Inconsistent read&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;DeadLocks/LiveLocks&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Execution Contexts&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Request&lt;/li&gt;&lt;li&gt;Session&lt;/li&gt;&lt;li&gt;Process&lt;/li&gt;&lt;li&gt;Thread&lt;/li&gt;&lt;li&gt;Transaction&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Isolation and Immutability&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Isolation and immutability are among two solutions for concurrency problems. In isolation, shared resource is isolated for only an active agents such as process in operation systems. Other approach is to make shared resource is immutable. If no active agent tries to change the shared resource, then there wont be &lt;em&gt;lost update&lt;/em&gt; or &lt;em&gt;inconsistent read problem&lt;/em&gt;. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Optimistic and Pessimistic Concurrency Control&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;If we can not enable a isolated or immutable shared resource, then we have to carry out either an optimistic or pessimistic concurrency control. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;In optimistic concurrency control, shared resource is allowed by two or more active agent and then a conflicts are detected. If there is a conflict, it is asked user to make decision (to merge, or cancel) similar to source control system such as CVS or SVN. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;In pessimistic concurrency control, once an active agents starts to work on a shared resource, agent locks it, and other agents can not access it until the active agent unlock the shared resource. Unlike optimistic approach, while this approach maximise the concurrency, it suffers from low availability as a shared resource is accessed by only one agents at a time.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Severity of conflict and frequency of changes are the two major factor deciding which approach to use. If change frequency is high and severity of conflict is low then optimistic approach can be chosen. But if conflict is major factor then pessimistic approach is the answer. But these two approach comes along with additional problems such as deadlocks and livelocks.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Transaction&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Transaction is one of the primary technique for concurrency control. A transacation is a sequence of work with consistent states and well defined start and end points. All works in transacation are carried out completely nor neither of them if one fails (rollback). Transaction can be defined with following four properties (ACID)&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Atomicity:&lt;/em&gt; Transaction as a whole is an atomic process. Namely, if a step in the transaction fails, then all other steps will be rolled back. Transaction finishes successfuly with an commit statement. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Consistency:&lt;/em&gt; During all step of transaction, system state must be consistent and noncorrupt. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Isolation:&lt;/em&gt; Results of each internal steps in a transaction is not visible to other transaction until it finishes with a commit statement.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Durability&lt;/em&gt;: Commit statement must do result of transaction persistent. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Databases, message queues, ATM, printers are the sample transactional resources. A transaction should be short as much as possible. If a transaction takes more than a request, then it is called &lt;em&gt;long transaction. &lt;/em&gt;And if a transaction' s lifeycle is bound to only a request's, then it is called &lt;em&gt;request transaction,&lt;/em&gt; in other words, it starts and finishes with requests. Another variation is &lt;em&gt;late transaction&lt;/em&gt; which works for only updates. It does not prevent inconsistent reads. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Transaction Isolation Levels&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Isolation levels are defined in terms of three factor:&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Dirty Read:&lt;/em&gt; You are permitted to read uncommitted or dirty data. Data integrity is compromised, foreign keys violated and unique keys ingored.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Non-Repeatable Read:&lt;/em&gt; It means a row can be updated at two different time, T1 and T2 and each time, you would get a different updated data.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Phantom Read:&lt;/em&gt; If you read a row at time T1 and then later T2, data will be same on the row but more related row data is added to table. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;ISO 92 standard defines four transaction levels (from low to high):&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Read Uncommitted&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Read Committed&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Repeatable Read&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;Serializable&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;table cellspacing="1" cellpadding="5" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Isolation Level&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Dirty Read &lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Unrepeatable Read&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Phantom&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Read Uncommitted &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;YES &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;YES &lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;YES &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Read Committed&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;NO&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;YES&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;YES&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Repeatable Read&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;NO&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;NO&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;YES&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Serializable&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;NO&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;NO&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;NO&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;Chapter 6. Session State&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;A session in a distributed environment system can either be: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Statelessness:&lt;/em&gt; System does not retain state between requests. When a request invoke a method, the state of the objects used by the method are not known. As default, HTTP protocol is stateless. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Stateful:&lt;/em&gt; System stores or keep track of states or information between requests. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Stateful system requires more resource as each stateful object has to to store all its states. On the other hand, a stateless object can be other requests too. But in real life problems, we need to store states. Therefore, best approach would be to store states on a stateless server.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Session States&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Session state are the states that they are bound to session and isolated from other concurrent sessions. Lifecycle of a session state is limited with session's, so if you want to persist states further than business transaction, they should be persisted on other medium such as on databases. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Session states in business transaction has to obey fundemantal rules of transaction (ACID) when business transaction finished. For example. during business transaction, session states maybe be in invalid or inconsistent, but before commit, they have to be consistent with the rest of the data. But more important concern is the isolation between session states. Operations in business transaction must not cause an inconsistent data cos of multiple concurrent read and updates. Session states must be kept isolated from other sessions. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;For performance reason, some data can be stored in sessions as part of a cache mechanism between requests. But this data is not a session state. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Methods to Store Session State&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Client Session State:&lt;/em&gt; Storing data on client side. Most common methods: encoding data on URL, cookies or hidden form variables in html. Often these session data has to converted to right format in server side. If the amount of data is large and frequent, that approach suffers bandwith problem. It also exposes security and data integrity issues, unless data encryption is applied.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Server Session States:&lt;/em&gt; For example stroring data on server's memory or more for further persistence, serialized object can be stored on filesystem or database table where session id would be primary key and serialized object would be value. In case of session migration, transfering session to another server, session states have to stored in a shared resource or memory. That approach is good when session states are continouosly proccessed. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Database Session States: &lt;/em&gt;It is also server side but object's states are mapped to columns in a table for a longer persistence. Special attention has to be paid to secure isolation of session data in databases. In terms of performance, this approach is appropriate when session data is idle most of the time, for example in a public retail system.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Session data has to be cleared after some timeout or if request is cancelled. In case of client session state approach, this is not big concern as much others. A timeout has to be put place in server and database session states. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;These three approaches can be used all together. But generally Server and Client session states are mostly used in practice. As pointed out above, if data is small and not complex, client session states is a good candidate. If you need failover, clustering and isolation between session is not problem, then Database session states can be used. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-264882764269919841?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/264882764269919841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=264882764269919841' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/264882764269919841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/264882764269919841'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/09/patterns-of-enterprise-application.html' title='Patterns of Enterprise Application Architecture by Martin Fowler'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-5611226477529402084</id><published>2008-08-03T05:39:00.000-07:00</published><updated>2008-10-17T05:35:05.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Credit Crunch and "The Revolutionary Idea of Karl Marx" by Alex Callinicos</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;With parallel to the current credit crunch and global financial crisis, lately an interest into economy and finance has arisen in me. I started to wonder how economy works. In the last couple of months, I read couple of popular economic books such as &lt;/span&gt;&lt;a href="http://books.google.co.uk/books?id=6BLqprHdwygC"&gt;&lt;span style="font-size:85%;"&gt;The Undercover Economist&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;. Unfortunately they failed to answer some of my questions. So i decided read something from a critics of liberal capitalist economic system such as Karl Marx. As many of you know, as a philosopher, academic and theoritical revolutionist, he is one of the most influential person of the modern times. My research on the net led me to an interesting free online e-book "The Revolutionary Idea of Karl Marx" by an British academic &lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Alex_Callinicos"&gt;&lt;span style="font-size:85%;"&gt;Alex Callinicos&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;. You can download it from following address :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.istendency.net/pdf/revideas.pdf"&gt;&lt;span style="font-size:85%;"&gt;http://www.istendency.net/pdf/revideas.pdf&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;This book gave me an absolutely different perspective on original idea of Karl Marx. As he pointed out in his latest years ("&lt;em&gt;All I know is that I am not a Marxist&lt;/em&gt;") many of of Marx's ideas are misunderstood, twisted or not implemented in the correct way. In this biography Callinicos explains the revolutionary idea and life of Karl Marx in a plain way. Even more, in a way, the book gives an insight to the fundamental reasons of latest financial global crisis as Trotsky also pointed out: &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;"Capitalism does live by crises and booms just as human being lives by inhaling and exhaling... Crises and booms were inherent in capitalism from birth; they will accompany it to its grave." &lt;/span&gt;&lt;/em&gt;&lt;span style="font-size:85%;"&gt;(This quote from Trotsky always comes to my mind whenever a financial expert on TV try to explain the fundamental reason of latest crisis and bonus culture in the city.) &lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Although i think some of Karl Marx's ideas are irrelevant now, it is still a great book to read to understand modern politics, economy and class based social life. &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-5611226477529402084?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/5611226477529402084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=5611226477529402084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5611226477529402084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5611226477529402084'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/08/credit-crunch-and-revolutionary-idea-of.html' title='Credit Crunch and &quot;The Revolutionary Idea of Karl Marx&quot; by Alex Callinicos'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-236869697390863813</id><published>2008-06-30T11:18:00.001-07:00</published><updated>2008-08-03T05:34:44.199-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>The Career Programmer: Guerilla Tactics for an Imperfect World By Christopher Duncan</title><content type='html'>Likewise many software engineer graduates, i took several project management and software development related courses. Most of these courses and topics were boring, based on theory, out of touch with reality and practically. I don't have good memories on these courses. &lt;br /&gt;&lt;br /&gt;Recently I come cross a brilliant, funny, practical e-book &lt;a href="http://www.amazon.com/Career-Programmer-Guerilla-Tactics-Imperfect/dp/1590590082"&gt;"The Career Programmer: Guerilla Tactics for an Imperfect World"&lt;/a&gt; by Christopher Duncan. The title of the book actually explains lots.  The author narritives his real world work experiences with a witty, funny, daily life language. I think this book should be a must reading for software engineering students.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-236869697390863813?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/236869697390863813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=236869697390863813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/236869697390863813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/236869697390863813'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/06/career-programmer-guerilla-tactics-for.html' title='The Career Programmer: Guerilla Tactics for an Imperfect World By Christopher Duncan'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-5053315677909002998</id><published>2008-06-22T05:17:00.000-07:00</published><updated>2008-10-17T05:35:05.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Churchill A study on Greatness by Geoffrey Best</title><content type='html'>Garry Kasparov, in his book "&lt;a href="http://denizstij.blogspot.com/2008/05/how-life-imitates-chess-by-garry.html"&gt;How life imitates chess&lt;/a&gt;", talks with great admiration and enthusiasm about Winston Churchill. Even further Kasporov claims that Churchill one of the biggest personality of 20th century. He is not alone. Many people share similar enthusiasm about him. Enormous studies have been conducted on him. Given that much coverage by media and scholars, i decided to read an auto/biography on him. &lt;br /&gt;&lt;br /&gt;My research on Internet led me to a relatively recent published book: "&lt;a href="http://www.amazon.com/Churchill-Study-Greatness-Geoffrey-Best/dp/1852852534"&gt;Churchill A study on Greatness&lt;/a&gt;" by Geoffrey Best whom teaches history at Sussex University. The book is compiled out of enormous literature research. In this book, Geoffrey Best aims to cover overall respects of Winston without much penetrating into details. &lt;br /&gt;&lt;br /&gt;Although Geoffrey Best puts an incredible work to justify how great was Winston Churchill in its historical context, unfortunately, given the stories and evidence in the book, my impression and thought about Winston is completely different and, to surprise myself, it is, even worse,a disappointment. To credit to the author, he points out in the book, given the evidences and stories, readers should make their mind on Winston Churchill themselves. Unlike the author and many people, given my working class, non-white, social-democrat background, i am failed to see why Churchill is a great man in terms of international and national politics, war leader, personality, literature, family. Let me elaborate my thoughts on these subjects.&lt;br /&gt;&lt;br /&gt;Let's start with a summary of his peculiar personality. In his all life, even though Churchill did all his best to evade any type of classification, people knew him and some historian describe Churchill as egoist, gambler, loves luxury lifestyle, rude to people working under him, difficult to work and get along together, Victorian Liberal Imperialist, opportunist, man of war (warmonger) and peace, enemy of working class people, believer of white-superiority of Anglo-Saxoinism and Tory radical, sympathetic to Zionism, imperialist, good political speaker and writer. Sure, i think some of these are over-exaggerated. &lt;br /&gt;&lt;br /&gt;Winston Churchill is known well as politician and military background. After high school,he attended Royal Military Academy for two years and he commissioned as Second Lieutenant. As service man, he deployed to various part of British Empire, Cuba, India, South Africa, Sudan and Malakand. Even though he disliked traditional education system in his school times, he self educated himself during the service. In addition, he also wrote articles as war correspondence to several London based newspapers. He was a brave soldier and participated in several risky campaign.&lt;br /&gt;&lt;br /&gt;Winston Churchill, first of all, was a politician. After spending five years in the army, in 1900, he started his political career in the conservative party where his father was also a hard-core MP. But he did not stayed there for a long time. In his second election, against his families and father's will and tradition, he transferred to the Liberal Party where he assumed doors and posts will be opened more quicker. He was right. Soon, he undertook important positions in the party and the governments between in 1905 and 1916 till disastrous defeat in the battle of Gallipoli against Turks in which he was Admiral. He never recovered from that bad publicity caused deu to his role in this battle. &lt;br /&gt;&lt;br /&gt;As politician, he was big supporter of free trade and in many circumstances he comes cross as an opportunist. Especially in the beginning of his career in the Liberal Party, in election campaigns, even though he comes from aristocracy, he gave speeches that House of Lords should not be superior than House of Common upon he sensed the unhappiness among the working class electorates against aristocracy. In 1924, he rejoined the conservatives and until 1929's he undertook the position of Chancellor of the Exchequer  in the conservative government. Some economics believe that, his decision to return to the gold standard at the pre-war parity in 1925, would lead to a world depression. In industrial conflicts and strikes, in many occasion, he put his preference on business elite and he made a reputation as enemy of working class people. &lt;br /&gt;&lt;br /&gt;Upon 1929 general election lose, Churchill stayed away from politics for couple of years. This isolation is due to his personal relations with party management, his stand against India policy and his connections with dubious peoples. When he backed to Parliament in first half of 30s, he vigorously established an anti-Indian, Nazi and Communism campaign. But none of his opinions is taken into consideration by majority of people cos of his warmonger, imperialist attitude. With WW II, in 1940 he backed to main political arena again as Prime minister due to his military background. &lt;br /&gt;&lt;br /&gt;Overall, both in Liberal and Conservative parties until 1940, he was not an extraordinary politician and not put his name under long term significant works. He made reputation as egoist, opportunist, rude to people working under him, difficult to get along together, Victorian Liberal Imperialist, warmonger, enemy of working class people, anti Nazi and Communist, opposite to Indian independence, supporter of white-superiority of Anglo-Saxinism and sympathetic to Zionism. Even more, in all his political life, it seems, because of his love to luxury lifestyle, he never hesitated to get financial help from his rich friends. &lt;br /&gt;&lt;br /&gt;During WW II, as prime minister and leader of national coalition government, he led his country against Nazi Germany. And he owes all his popularity to this role. For his countrymen, he is the saviour of not only UK but also civilization against Nazi. I think his role in WW II is overrated. I think he was only the defender of his country. UK could not won the war by herself, and it took long time, in spite of mass colonies and resources. Fate of the war only has changed after Soviets and America joined to the war in Allies side. Besides all of these, there are doubts on his leadership skills. &lt;br /&gt;&lt;br /&gt;Without doubt, Winston Churchill was a good speaker and boosting morale of public in war times. But I wonder if someone else would be able lead better the army and country in WW II? Because people working under him often say that he was full of ideas. For an issue, he was coming up more than 10 different ideas. Unfortunately, so often, only one of these ideas was plausible and his staff wasted quite lots of time to argue about impractical side of his other ideas. You can guess how it would be difficult to work with someone who especially thinks: "All i wanted was compliance with my wishes after reasonable discussion". Who knows maybe with a better leader, the war would have been won more faster against Nazis. I think, the public should have shared the similar frustration with his management, so after WW II, in the first election in 1945, Labour party defeated Churchill with an unprecedented seat majority in the Parliament. Besides these, short after Nazi Germany was defeated, in international meetings, Britain could not defend her interest well against Soviet Union and America. Some diplomats complaint that Winston Churchill attended meetings without much preparation, even worse, sometimes without reading the briefings. &lt;br /&gt;&lt;br /&gt;Someone would argue that, given the historical context and resources, Winston Churchill achieved incredible results. But i can not help to think that, people can create miracles in real tough circumstances. 20th century has being witnessed many great national leaders in many wars in which superior countries attacked small, tiny countries but dramatically been defeated. I think, if opportunities were given to other people, Britain would had achieved better with a more skillful person. But without any doubt, unlike the battle of Gallipoli in WW I, Winston Churchill did not let his country down in WW II with help of Soviet and America.&lt;br /&gt;&lt;br /&gt;Towards to end of WW II and afterwards, in government and opposition seats, he introduced the main seeds of European Union movement. After WW I, not many people in Europe was thinking there would be another war in Europe soon. But WW II proved that that assumption was so optimistic. In order to prevent such a third war in Europe and against Soviet occupation, Winston Churchill developed and introduced European Union movement. He worked and campaigned on this idea especially when he was on the opposition between 1946-1951. But when he came to power again in 1951, he put his preference on America once again and focuses on the "special relationship" with America. But on the other hand, he always iterated that UK will be always  with Europe to against Soviet. To credit to him, whatever his motive was, Winston Churchill was one of the prior in European Union movement. &lt;br /&gt;&lt;br /&gt;After WW II, having defeated Nazism, Winston Churchill turned his all attention to the old enemy, Communism. Expansion of Soviets to East Europe after WW2 caused concern among western European countries and Churchill used this atmosphere to promote his anti-Communism in UK and USA. His tone of language against Soviet got more stronger with time and he established his new political career on anti-Communism. He was even accused of being a provocateur, warmonger by some Labours. He was the principal architect of Iron Curtain betwen Soviet and West. It seems to me, in order to come power again, Churchill and some conservatives promoted a political tension in between Soviet block and Western countries which lasted until the end of the century. Once more, this tactic of seizing power and keeping people under control by creating a common enemy is used against Muslim by neocons after communism collapsed.&lt;br /&gt;&lt;br /&gt;His stands on non-white European colonies and countries were imperialist and he was big believer and supporter of white-superiority of Anglo-Saxionism. Without much change, in his all political life, he opposed of independence of India. His following remark on Gandhi in 1930 explains his conservative, aristocratic, imperialist, politic background: &lt;br /&gt;&lt;br /&gt;&lt;em&gt;"A seditious Middle Temple lawyer now posing as a fakir of a type well-known in the East,striding half naked-up the steps of the Vice-regal place... to parley with the representative of the King-Emperor."&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Winston Churchill had tendency that non-white people can not run their countries themselves. For example, with irony, he claimed that Indian people would be better under the British rule because he thinks that non-white people are lack of self management. Irony is that, in his white aristocratic, imperialist world, in spite of limited academic, military and political achievement and inter personal skills, a white aristocrat can become an MP and even more a Prime Minister, but a non-white person such as Gandhi, who is a lawyer and graduated from London, loved and respected by millions in India is not capable of self management! &lt;br /&gt;&lt;br /&gt;Luckily India has not suffered much from his opposition. But Middle East suffered dramatically cos of his and his peers's policies, prejudice, ignorance and sympathy to Zionism. After first WW I,he was in charge of determining new borders in Middle East. New borders are drawn without taking into consideration of local people's opinion and many current problems in Middle East (Palestine, Jewish, Kurdish, Arabs) are attributed to role of his role. In these talks, he did not even want to meet with Arab delegates. &lt;br /&gt;&lt;br /&gt;Another interesting characteristic of Winston Churchill was that he earned his livelihood from his pen when he was not in the Parliament. He published several books on military, WW I and II and English speaking world. He also wrote many articles for newspapers. At the moment i am reading, his "My Early Life" book, later i would be able to comment about his writing style. He won the Nobel Prize in Literature 1953. He hired several, Oxford graduated writer to help him in his latest books after WW II. There is also not much known artistic side of Winston Churchill. In his free times, he painted and vivid colours were dominant in his paintings. &lt;br /&gt;&lt;br /&gt;In family side, although he was close to his children and biggest admirer of his wife, his children did not catch up any of his success or popularity. His son, Randolph, followed his fathers step in terms of career, personality and lifestyle and with failure. Some of his daughters made unhappy marriages. Most interesting part of his life, surprisingly, his never lasting love to his wife. He and his wife, were biggest supporter of each other all the time. &lt;br /&gt;&lt;br /&gt;In conclusion, I do understand admiration of Kasparov to Churchill because Winston was the first person in Western warned and even more provoked people against Communism. He was the main ideologist in the West created so-called Communist Monster. But, i think, Kasparov misses a crucial thing. Due to his character, Churchill never lack of enemies or suspicion of stranger/foreigner. In order to keep his status, he and neo-cons always created an enemy. His stand, vision on Communism is more prejudice similar to his attitude against India, Middle East, Palestine and desire and hunger to the power.&lt;br /&gt;&lt;br /&gt;Based on this book, i think, Winston Churchill is really overrated in its historical context. I do understand this pheromone from the British, conservative point of view. Every nation or political movement has tendency to satisfy their ego anyhow with national heroes. But from an objective point of view, I think British Empire should/would have done better without Winston and there are certainly far far better statesman in 20th century in all around the world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-5053315677909002998?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/5053315677909002998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=5053315677909002998' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5053315677909002998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/5053315677909002998'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/06/winston-churchill.html' title='Churchill A study on Greatness by Geoffrey Best'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-8695129360542895697</id><published>2008-06-20T15:29:00.001-07:00</published><updated>2008-10-17T05:35:05.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='review'/><title type='text'>Losing My Virginity: The Autobiography by Richard Branson</title><content type='html'>Richard Branson is one of the British about whom i have been getting positive remarks whenever his names comes up in a conversation. He is known well with his entrepreneurial business skills (creator of Virgin brand), generous support to various charities, connections with various political and non-political figures, and of course, his sport challenges, some of which has, understandably, patriotic aspect. But, like many other people, my personal experience with Richard Branson is limited, through his companies, Virgin, as a customer and it is mixed with satisfaction (virgin trains) and frustration (virgin media).&lt;br /&gt;&lt;br /&gt;Even though, Branson is one of the well known celebrety entrepreneur in Bratain, it is so rare to see him on public events (even on enrepreurial related TV prograns such as Dragons Den). It seems he enjoys his privacy and prefer to stay away from public attention which make people more interested in his life. His autobiography "Losing My Virginity: The Autobiography" is a good reference for those who interested in him and history of Virgin.&lt;br /&gt;&lt;br /&gt;In his autobiography, his extra ordinary, colorful life is fluently told in a relatively long way (now it is about 600 pages, and he updates it regularly every year). Although, last two chapters (2006 and 2007) kinda come across as snapshots from his busy calendar, this book suprisingly is worthwhile to read.&lt;br /&gt;&lt;br /&gt;Richard Branson is born into a post war England in 1950. He is the oldest children of Ted and Eve Branson both of them actively involved in WW II. Richard with his two sisters had a peaceful childhood in Surrey. He describes his family as that would have killed for each other. That special bond between him and his family, especially with parents can be sensed through the pages whole book.&lt;br /&gt;&lt;br /&gt;He remembers his childhood full of challenges which were set up by his parents and relatives to make him self-sufficent and creative. These challenges were generally sportive and business oriented rather than academic. This was not a coincidence. Since Richard has dyslexia, his academic record was not good, however how much he tries hard in schools. In these times, when dyslexia was not known, and pupils who fail at Math are branded as stupid, sportive activies were the only way to survive in school. So, Richard focused on sport and made a good reputation as football player in school team. But after an accident in field, doctor banned him participating any sportive activities which led to a miserable school life. Upon the accident, he spent his most of the time in library, far away from eyes, but girls.&lt;br /&gt;&lt;br /&gt;One of most apprepciated characterisitct of Richard, i think, his modesty and personality. From the first pages of the book, it came cross to my mind that maybe he owes his personality to a degree to his dyslexia which made him more sensetive, conscious, caring to other people. My this superficial thought is got stronger when i read Sally Gardner's interview on a magazine. Likewise Richards Branson, Sally Gardner is a dyslexia and she makes livelihood writing children books. She does not also recall great memories from her schooltimes due to her dyslexia. She explains affect of dyslexia on personality by : "After such a long period of time seen as a misfit you always feel an outsider. It is something that never leaves you. I will always be a round ball in a square hole. "&lt;br /&gt;&lt;br /&gt;Since neither in academic nor sport(after the accident) he was successful, he directed his all effort to small scaled business plan in his childhood. In high school, about in the second half 60's, when students rebelling against established system in all around the world, he came up with the idea of a student magazine called Student. With a childhood friend, he set up the magazine. While his friend was editor of the magizine, he took all financial and organizational responsibilities. He and his friends made Student one of the biggest magazine for student in 60's. While content contributors of Student were generally leftist, he tried to keep himself in neutral, as a business man.&lt;br /&gt;&lt;br /&gt;He learnt quite lots of deal about marketing and business and made extensive business network out of Student. As far as i see from the book that Richard Branson tries to apply all these lessons to all his business deals till now. Some of these lessons are that a succesful business is a team work and must enjoyable, the satisfaction of staff comes first and taking risk is essential to grown the business.&lt;br /&gt;&lt;br /&gt;Rather than discussing about his success in business, i would like point out something else which i could not help myself noticing through the pages. As i mentioned above, Branson is very keen to his family, parents, sisters, children and wife. I dont want to speculate on his personal life, but with respect, i am a bit suprised that he did not mentioned so much about his second wife, Joan, mother of his two children and love of his life. Through lines, she comes cross as just a good, modest mother and full time house wife. But i am sure she is more than just these, as you guess, partners have big impact on someone's success. For example, Clementine, wife Winston Churchill, was the biggest supporter of his husband in many matters in peace and war time.&lt;br /&gt;&lt;br /&gt;I think it would be very revealing to read biography of Joan&amp;amp;Richard Branson from  one of their children  (for example Holly Branson who recently graduated from University College in London  with MD) for a objective and insider aspect to the life of Richard Branson.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/32004202-8695129360542895697?l=denizstij.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://denizstij.blogspot.com/feeds/8695129360542895697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=32004202&amp;postID=8695129360542895697' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8695129360542895697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/32004202/posts/default/8695129360542895697'/><link rel='alternate' type='text/html' href='http://denizstij.blogspot.com/2008/06/since-i-step-into-england-sir-richard.html' title='Losing My Virginity: The Autobiography by Richard Branson'/><author><name>Deniz Turan, PhD</name><uri>http://www.blogger.com/profile/14852733041940038084</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='21' src='http://3.bp.blogspot.com/_n3R9tfLFKTo/SPYG-b4REVI/AAAAAAAAABA/_MRWHTZSV5Y/S220/Festival+053.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-32004202.post-2438989672446168375</id><published>2008-06-09T13:15:00.000-07:00</published><updated>2008-10-17T05:36:02.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java/j2ee'/><title type='text'>Software Tests in GWT</title><content type='html'>&lt;p align="justify"&gt;Since software development in GWT is based on Java, many conventional and well-practiced test techniques related to Java can be utilised for applications developed using GWT. Following test techniques are supported by GWT:&lt;/p&gt;&lt;p align="justify"&gt;·         Unit testing (JUnit by extending GWTTestCase)&lt;br /&gt;·         Performance testing (Benchmarking, by extending Benchmark)&lt;br /&gt;·         Robot testing ( Selenium, UI test)&lt;br /&gt;·         Continuous Testing (Cruise Control)&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Unit Test (JUnit)&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;strong&gt;&lt;p align="justify"&gt;&lt;br /&gt;&lt;/strong&gt;Out-of-box JUnit unit test support is shipped with GWT for client and server side synchronous and asynchronous testing. Test cases that wish to make use of unit tests extend GWTTestCase. By default, tests are run in hosted mode with an invisible GWT browser. GWT JUnit tests are generally designed for non-UI testing. More precisely they are used to test the logic and functionality of GWT applications (especially server side functionality). For UI triggered robot tests Selenium should be preferred.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;Since GWT unit tests extends standard JUnit (version 3, not JUnit4), conventional JUnit test approaches (such as use of Assert assertion methods) can be used for GWT unit test cases.  Each GWT JUnit test extends GWTTestCase and implements getModuleName() method which defines the interest of GWT module. &lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;GWT JUnit supports asynchronous tests by introducing two methods, finishTest and delayTestFinish. delayTestFinish   makes sure that test does not terminates immediately but wait for a period of time to handle asynchronous callbacks. As soon as a result obtained from asynchronous callback, finishTest should be invoked to finish test successfully, otherwise  delayTestFinish  will cause a timeout exception to fail test.  In addition those, chain pattern can be implemented for invoking several asynchronous serially to simulate UI cases.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;JUnit tests can be run either in hosted (default) or web mode (-Dgwt.args="-web" ,with various browsers).  During hosted mode, cross browser compatibility is not checked. For this purpose, tests must be run against different browser in web mode.  Corresponding to application size, compilation time can be longer (1-5 min) in hosted compared to web mode.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;Please note that, in GWT 1.5 MS2 and RC1, the base test class which implements getModuleName() method must have the same package name as the package name of the module entry class. For example, for module com.booo.Boo.gwt.xml, the package name of the base test class should be  com.booo.client&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Performance (benchmarking)&lt;br /&gt;&lt;/p&gt;&lt;/strong&gt;&lt;p align="justify"&gt;With GWT 1.4, a benchmarking scheme is introduced to test performance of client side code. For profiling and reporting, in GWT, a benchmarking test class must extend Benchmark which is subclass of GWTTestCase.   In addition to standard JUnit facilities, Benchmark provides automatic iterative test case invoking for given range or Iterator.  Please refer to [1] and [2] for further information.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;The biggest disadvantage of Benchmarking in GWT, unfortunately, it does not yet support asynchronous calls and access to server side code. This severely limits its use for testing performance of a whole application.  Instead, it is better used to benchmark stand alone client side code.&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Robot  (Selenium)&lt;br /&gt;&lt;/p&gt;&lt;/strong&gt;&lt;p align="justify"&gt;Selenium is a de facto standard for robot UI testing. Selenium performs automatic UI trigger based tests against a given valid URL. Selenium utilises generally HTML elements' ids to carry out operations such as clicking buttons, editing input text or selecting an item from a list box.&lt;br /&gt;These operations can be performed manually by a user on Firefox with the Selenium IDE which records all of these operations sequentially and then converts them to a Selenium JUnit class (extending SeleneseTestCase). These test cases can be aggregated in continuous tests similar to standard JUnit tests. Selenium supports continuous tests out-of-box with  &lt;em&gt;selenese&lt;/em&gt; Ant tasks [3].&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;Since any changes on the UI directly affect these tests, UI developers have to be careful in terms of naming or identifying HTML elements. If Selenium testing is chosen for robot UI testing a systematic schema has to be agreed and developed between QA and the UI developer.  In addition to that, UI developer must use appropriate UI widgets and libraries which support identifying HTML elements for Selenium test.&lt;/p&gt;&lt;
