"Only buy something that you'd be perfectly happy to hold if the market shut down for 10 years," said Warren Buffett. This, of course, is easier said than done. In fact, the advice seems so naive that it's tempting to dismiss. Maybe that's why Buffett has also said, "There seems to be some perverse human characteristic that likes to make easy things difficult."

Accepting his rebuke, let's indulge ourselves in seemingly irrational long-term thinking with decades -- not years -- in mind. Finding investments that are likely to last a decade and provide handsome returns would require an investment to meet two criteria: It should be an enduring market leader with excellent economics, and it should be reasonably priced or even undervalued. Here are two stocks that could fit the mold.

Apple (NASDAQ:AAPL)has a significant lead on competitors in the fast-growing worldwide tablet and smartphone markets in terms of profits. Apple boasts 72% of worldwide handset profits, according to Canaccord Genuity. Based on numbers from IDC, MacDailyNews estimates that Apple's share of worldwide tablet profits could amount to a whopping 85% -- and they insist that this is a conservative estimate.

Yes, Apple's gross margin has sank considerably, down 1,000 basis points to 37.5% compared to 47.4% in Apple's second quarter from the year-ago quarter. Nevertheless, a 37.5% profit margin for an original equipment manufacturer, or OEM, is very impressive. It takes serious economies of scale and brand power to achieve a feat like this in consumer electronics. How does Apple pull this off? Brand power! Consumers are still willing to pay premium dollars for Apple's products. This trend looks enduring given the iPhone's 90% retention rate. 

Apparently, however, the Street has found better investment opportunities elsewhere. Today, the stock trades at a paltry price-to-earnings ratio close to 10, making it one of the cheapest stocks in the S&P 500. This harshly contrasts with the average analyst estimate for 20.7% EPS growth per annum for the next five years. Surprisingly, this estimate is 5% per annum higher than the average estimate for Google over the next five years. Even so, Google trades at a significantly higher price-to-earnings ratio of 24.22

Baidu (NASDAQ:BIDU) (aka the "Chinese Google") boasts a 73% share of search market traffic in China, according to comScore. Compare that to Google's 66.7% share of the search market in the U.S. Despite the company's massive success in China, its stock has been hit hard.

The stock is already down almost 40% during the last 12 months and, at today's price, the stock is a bargain in relation to analysts' estimates. On average, analysts expect earnings per share to grow by 25% annually for the next five years. Yet, the stock trades at just 18.2 times earnings.

Baidu's growth story isn't over. In the company's fourth quarter of 2012, net income was up 36.1%, year over year. Furthermore, active online marketing customers increased 31%, year over year -- that's double the rate of growth of new clients in the year-ago quarter.

Going against the grain
As Buffett said in his 2008 letter to Berkshire Hathaway shareholders, "Whether we're talking about socks or stocks, I like buying quality merchandise when it is marked down." For the bargain hunters out there, these excellent companies have both taken a nosedive.

AAPL Chart

AAPL data by YCharts

Buying excellent companies at good prices is the best way to invest for the next decade. Both Apple and Baidu offer opportunities for investors to do this today. What do you think? Are Apple and Baidu great opportunities at today's prices?

Fool contributor Daniel Sparks has no position in any stocks mentioned. The Motley Fool recommends Apple, Baidu, Berkshire Hathaway, and Google. The Motley Fool owns shares of Apple, Baidu, Berkshire Hathaway, and Google. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.