Calculation of Intrinsic Value

I have created an excel sheet that could be usefull when calculating Intrinsic values of stocks.
All you have to do is open the excel sheet, and fill in the red numbers in the excel sheet, which you can find on the links next to each box.
Excel will then automatically calculate the intrinsic value of the stock you are analyzing.
If you want to change the ticker, open a hyperlink in a box next to a red number, and change the ticker in the web address.
For example, if you are looking at http://finance.yahoo.com/q/ks?s=PEP+Key+Statistics and you would like to see the data of Coca Cola co. instead of Pepsico, change the ticker from PEP (which is the ticker of Pepsico) to KO (which is the ticker of Coca Cola).
The link to visit then becomes: http://finance.yahoo.com/q/ks?s=KO+Key+Statistics for example.
Method number one is a very simplistic model, which calculates a price target for the next 5 years based on historical valuations, the last 4 quarters results and future growth.
Method number 2 is more advanced, and takes into account Free cash flow, net cash position and future growth.
This method discounts the future values at a discount rate of 9% per year, which is the return you can expect over the long run in the stock market (7% price appreciation per year + 2% dividend yield per year).
To open the excel sheet, please click hereCalculate_Intrinsic_Value
Please be aware that calculating an intrinsic value is not an exact science. It is based on subjective estimates.
The best thing you can do is to use methods used by the biggest value investors in the world, such as Warren buffet, Joel Greenblatt, Monish Pabrai and the likes…

How to Set Timezone on WebSphere Application Server

It’s actually quite easy, but a little tricky. This is how i do it,
1. Start the administrative console.
2. In the topology tree, expand Servers and click Application Servers.
3. Click the name of the application server for which you want to set the time zone.
4. On the application server page, click Process Definition.
Process Definition
5. On the Process Definition page, click Java Virtual Machine.
6. On the Java Virtual Machine page, click Custom Properties.
7. On the Custom Properties page, click New.
8. Specify user.timezone in the Name field and timezone in the Value field, where timezone is the supported value for your time zone.
9. Click Apply.
10. Save the configuration
In this example, i’m setting my timezone as Asia/Jakarta

user.timezone=Asia/Jakarta

Timezone Success http://edwin.baculsoft.com/2011/08/how-to-set-timezone-on-websphere-application-server/

What does Disposition (Non Open Market) at $0 per share. MEAN?? I see this when insiders trade in a company?

It means that an insider is disposing of (disposition) some stock in a private transaction (non open market) at a price of zero. What this usually means in plain (er) English is that the person is giving away stock, possibly as a gift or a donation. These types of transactions can also show up as “acquisitions” if the insider is receiving stock for some reason.

http://sg.answers.yahoo.com/question/index?qid=20071117221632AA6cSSz

Build failed question – maven – jre or jdk problem

You could try updating the JDK Eclipse is using, as follows:
Add and set the JRE in Window->Preferences…->Java->Installed JREs:

JRE type: Standard VM JRE Name: jdk1.6.0_18
JRE home directory
: C:\Program Files (x86)\Java\jdk1.6.0_18

If this is not the case, it’s possible that the brackets and spaces in the JAVA_HOME path are causing issues. Try copying your JDK to a different location and updating your JAVA_HOME.

http://stackoverflow.com/questions/2222560/build-failed-question-maven-jre-or-jdk-problem

What’s the key difference between HTML 4 and HTML 5?

HTML5 has several goals which differentiate it from HTML4.

The primary one is consistent, defined error handling. As you know, HTML purposely supports ‘tag soup’, or the ability to write malformed code and have it corrected into a valid document. The problem is that the rules for doing this aren’t written down anywhere. When a new browser vendor wants to enter the market, they just have to test malformed documents in various browsers (especially IE) and reverse-engineer their error handling. If they don’t, then many pages won’t display correctly (estimates place roughly 90% of pages on the net as being at least somewhat malformed).

So, HTML5 is attempting to discover and codify this error handling, so that browser developers can all standardize and greatly reduce the time and money required to display things consistently. As well, long in the future after HTML has died as a document format, historians may still want to read our documents, and having a completely defined parsing algorithm will greatly aid this.

The secondary goal of HTML5 is to develop the ability of the browser to be an application platform, via HTML, CSS, and Javascript. Many elements have been added directly to the language that are currently (in HTML4) Flash or JS-based hacks, such as , , and . Useful things such as Local Storage (a js-accessible browser-builtin sql database, for storing information beyond what cookies can hold), new input types such as date for which the browser can expose easy user interface (so that we don’t have to use our js-based calendar date-pickers), and browser-supported form validation will make developing web applications much simpler for the developers, and make them much faster for the users (since many things will be supported natively, rather than hacked in via javascript).

There are many other smaller efforts taking place in HTML5, such as better-defined semantic roles for existing elements ( and now actually mean something different, and even and have vague semantics that should work well when parsing legacy documents) and adding new elements with useful semantics –

,

,

,

, or

, making the structure of your document much more intuitive.

http://stackoverflow.com/questions/134727/whats-the-key-difference-between-html-4-and-html-5

Where exactly the Singleton Pattern is used in real application?

Typically singletons are used for global configuration. The simplest example would be LogManager – there’s a static LogManager.getLogManager() method, and a single global instance is used.
In fact this isn’t a “true” singleton as you can derive your own class from LogManager and create extra instances that way – but it’s typically used as a singleton.
Another example would be java.lang.Runtime – from the docs:

Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method.

That’s pretty much the definition of a singleton 🙂
Now the singleton pattern is mostly frowned upon these days – it introduces tight coupling, and makes things which use the singleton harder to test, as you can’t easily mock out that component. If you can get away without it, so much the better. Inject your dependencies where possible instead.

http://stackoverflow.com/questions/3192095/where-exactly-the-singleton-pattern-is-used-in-real-application

difference between stored procedures and user defined functions

A function always returns a value, and can not perform DML statements (INSERT/UPDATE/DELETE).
A stored procedure can not return a value – you need to use an OUT parameter – and can run DML statements.

Advantage of Using a Function vs a Stored Procedure?


Aside from the comparison above, they are equal. But given the comparison, depending on what you need to do it’s likely you will use a stored procedure more often than you will a function.

http://stackoverflow.com/questions/2039936/difference-between-stored-procedures-and-user-defined-functions

Testing Private Methods in Java

I’ve been writing a lot of Java lately, and a lot of tests. We always write tests, right? Alas, no cool record-and-playback stuff like FlexMonkey or FoneMonkey, just plain old JUnit 4 tests with plently of Hamcrest goodness.

Suddenly, I realized that I really needed to test some private methods. So, a quick google for “testing private methods java” brings up a good article by Bill Venners. He lists all possible options to test private methods:
  1. Don’t test private methods
  2. Give the methods package access
  3. Use a nested test class
  4. Use reflection

Basically, the only real one is #4, use reflection. Bill didn’t give me the exact code I needed, so lots of googling later I realized that the world is filled with opinionated people (like me), and boy do they love to talk about #1. I just wanted some code, not a lecture, so I had to write my own code. Here is that code for anyone else that just wants to test private methods.

Imagine you have a class MyClass and it has a private method, myMethod(). Sorta like this:
public class MyClass {
private String myMethod(String s) {
return s;
}
}
Then you could use reflection to invoke the method like this:
MyClass myClass = new MyClass();
Method method = MyClass.class.getDeclaredMethod("myMethod", String.class);
method.setAccessible(true);
String output = (String) method.invoke(myClass, "some input");

The real magic is setAccessible(true) which allows the private method to be called outside the class. And shazam, I can now test all my private methods. I was really hoping JUnit 4 would provide some additional facilities specifically for testing private methods, but not luck.

http://saturnboy.com/2010/11/testing-private-methods-in-java/

How do you unit test private methods?

You generally don’t unit test private methods directly. Since they are private, consider them an implementation detail. Nobody is ever going to call one of them and expect it to work a particular way.
You should instead test your public interface. If the methods that call your private methods are working as you expect, you then assume by extension that your private methods are working correctly.

http://programmers.stackexchange.com/questions/100959/how-do-you-unit-test-private-methods

What is the difference between an ordered and a sorted collection?

An ordered collection means that the elements of the collection have a specific order. The order is independent of the value. A List is an example.
sorted collection means that not only does the collection have order, but the order depends on the value of the element. A SortedSet is an example.
In contrast, a collection without any order can maintain the elements in any order. A Set is an example.