Tuesday, September 21, 2010

C# Developers: Shred your forms to avoid memory leaks

If you develop an application which continues running for some time and uses several forms - you might have memory leaks you are unaware of. This might not be a big issue if your forms aren't utilizing too many system resources. In a recent project I was involved in, I had to tackle huge memory leaks due to Forms basic memory leaking faults: events.

Continue reading and view code below fold...

Monday, September 20, 2010

Deciphering the financial headlines while the market rallies

Dow up 1%, Nasdaq 1.28% - some stocks, my favorite ones, are really flying - while I'm sitting on the fence.

So what do the headlines on Yahoo!Finance say?

* Homebuilders' Confidence Stuck at 18-Month Low
* Stocks extend September rally ahead of Fed meeting
* Gold climbs to record on weaker dollar

I think that since gold is rallying, it should be a good exercise to view the value of the dow in gold, since the 'correction' has begun. Perhaps for some good stocks though, there's real 'end of the year window dressing' mutual funds purchasing pressure. This could last to the end of November.

* PS: SPY is breaking above resistance, while hovering above 200 SMA, next technical signal to look for to signify a bullish wave: 50 SMA cross-over. In addition, the last two dips represent a higher low. So technically, a rally is upon us. Fundamentally? Well - check the above headlines again...


Friday, September 17, 2010

Retirement Deficit: 6.6 Trillion, Seniors forced back to job market

No one wants to reach his golden years and discover he can't really retire. The havoc done to all retirement plans in the US over the last 3 years is undeniable and the damage would be long lasting. Allow me to quote two relevant stories:

U.S. Retirement Deficit Reaches $6.6 Trillion: 'God Help the Poor Gen Xers'
America's retirement crisis has reached epic proportions, according to a recent study by Boston College's Center for Retirement Research. The study estimates that the current retirement income deficit, or the gap between the retirement savings of U.S. households and what they need to have in order to maintain their living standards past retirement, is a whopping $6.6 trillion -- five times the projected federal deficit for 2010.

"The key sources of income retirees are relying on are either under attack, in the case of Social Security, or disappearing, in the case of traditional pensions," said Ross Eisenbrey, vice president of the Economic Policy Institute, at a press conference on Wednesday. "The early Boomers are better off than the late Boomers, and God help the poor Gen Xers. Seventy percent of them are on a track that leads to a fallen standard of living in retirement."

According to the latest retirement income data, half of 65-and-older households have an annual income of less than $29,744 -- about half the median income of younger households. Traditional pensions are disappearing in favor of 401(k) plans, which allow employers to shift much of the cost and all of the risk to their employees, and on top of this, Congress is considering cutting Social Security to balance the federal budget.


I'd advise watching out for people with certain agenda giving you these kind of news. There are communists and socialists for whom the solution to the problems we face is confiscate whatever we do have and replace it with some 'social security+' system. Have you ever heard a worse idea?

What do seniors who have not saved enough or were horribly damaged by financial collapse - what do they do? Go to work of course.

Beyond the 401(k): Seniors must work longer
After 30 years studying pension systems around the world, Alicia Munnell knows what works -- and what doesn't. As head of the Center for Retirement Research at Boston College, she warned early on that 401(k) plans would fail to provide the level of income that retirees would need. Not many agreed with her at first.

But by 2006, Congress, other academics, and much of the financial services industry had concluded that defined-contribution plans had some serious flaws. The result: the Pension Protection Act, which mandated 401(k) reforms such as encouraging auto-enrollment and the use of target-date retirement funds.

Those measures, however, aren't enough to fend off a coming crisis, Munnell argues.

With savings and housing wealth below peak levels, workers are less prepared for retirement even as Social Security deficits are expected to balloon, threatening future benefits. How to fix the mess? Munnell, a former economics adviser to President Bill Clinton, calls for broad changes in America's retirement system. She shared her ideas with senior writer Penelope Wang.


Raising the retirement age for full benefits to 70 or higher is something that's being talked about a lot now.


Yikes. That's preventing you from using your retirement funds so that some calculator at an epidemic's basement is happy with global and national studies.

OK - I'm light years away from my own retirement, seriously. I'm bringing these stories here for general info. If you are concerned about the state of your current investments, consider trying my free software: EzBacktest. Back-test your investment choices, and get some peace of mind - as you lay out plans to your far-future of hopeful retirement.


Wednesday, September 15, 2010

CNBC: Stock-Pickers, A Dying Breed?

Short answer: Nope. But current economy and market condition does and should scare the heck out of any thinking person.

Man Vs. Machine: Stock-Pickers, A Dying Breed?
Bob Olstein is a stock-picker's stock picker. He has been at it for 42 years-picking stocks the old-fashioned way: by the numbers.

Still, there are times the mutual fund manager admits to feeling outgunned by the machines and the proliferation of exchange-traded funds. "I absolutely feel like Jonathan Livingston Seagull right now-Okay?"

This has been a tough, confusing time for serious stock pickers, whose investment strategies are based on the fundamentals of businesses.

As stocks get swept into various indexes by ETFs and are actively traded via algorithms and machines, there is genuine concern that these changes are leading to the death of stock-picking as we know it.

"You can't fall in love anymore," says Cleve Rueckert of Birinyi Associates.

That's been a longtime theme of his boss, Laszlo Birinyi, who in 2003 published a controversial report in 2003 titled, "The Death of Long-Term Investing." (Watch video of Birinyi's most recent appearance on CNBC.)

Birinyi's thesis is that the impact of such regulatory changes as the SEC's fair disclosure regulation -requiring publicly traded companies provide material information to all investors at the same time-combined with the creation of new markets and the use of technology in trading would favor short-term thinking.



Tuesday, September 14, 2010

Back to school shopping revives economy?

Or will this number be revised quietly next month too? (yes I'm cynical, there have been WAY too many economic numbers fudged and then revised)

Retail Sales Up 0.4 Percent in August
Retail sales rose in August by 0.4 percent, a one-tenth percent uptick from the previous month, but comfort for retailers worried about a possible double-dip recession.

While retail sales overall rose one-tenth percent from the previous month, which was revised downward after also briefly showing a 0.4 percent gain, the number reported by the Commerce Department is the best since March.

The gains came in spite of a marked decline in auto sales, which took a 0.7 percent drop from July. Still, the 0.6 percent rise in retail sales besides autos is double what economists had expected


Saturday, September 11, 2010

Nintendo losing their edge vs. Microsoft and Sony. PS3 Move bundle available for pre-order

Paying $399.99, is it worth it? Let's do the math: Wii console with motion remotes costs $199.99, Blue-ray player with wireless access (for HD netflix) - costs $250, together you'd pay: $449 - and Wii's graphics looks like stone age compared to Sony's HD. The bigger question perhaps is - are there any more buyers in this market?

I think that those of us who don't yet have a Blue-Ray player - and increasingly disappointed by Wii - would certainly consider it.


Thursday, September 9, 2010

First domino down? Treasuries lower after disappointing 30-year bonds auction

If treasuries lose their 'safe haven' status - what remains?

TLT - 20+ years bonds ETF showing right now a 2% drop. Some might perceive it to be nothing more than a correction on security which is known to fluctuate in value. Short term treasuries still holding well (SHY).

Treasuries Extend Losses After Auction of $13 Billion in 30-Year Bonds
Treasuries fell as the government sold $13 billion of 30-year bonds after economic reports showed initial jobless claims dropped last week more than economists forecast and the trade deficit narrowed.

The bonds drew a yield of 3.820 percent, compared with the average forecast of 3.806 percent in a Bloomberg News survey of 9 of the Federal Reserve’s 18 primary dealers. The bid-to-cover ratio, which gauges demand by comparing total bids with the amount offered, was 2.73, versus 2.77 at the auction last month and an average of 2.65 for the past 10 offerings. Today’s sale, a reopening of the August sale, is the final of three note and bond auctions this week totaling $67 billion.

“There’s a lot of supply, not just here, but globally,” said Thomas Tucci, head of U.S. government bond trading in New York at the primary dealer Royal Bank of Canada in New York, before the auction. “There’s concern about the global supply picture and if rates will attract enough buyers.” As a primary dealer, RBC is obligated to participate in Treasury auctions.

The yield on the 30-year bond gained 10 basis points, or 0.10 percentage point, to 3.83 percent at 1:05 p.m. in New York, according to BGCantor Market Data. The yield on the benchmark 10-year note gained 9 basis points to 2.75 percent.

The extra yield that investors demand for 30-year bonds compared with 10-year debt was 1.07 percentage points before the auction. It touched a record high 1.25 percentage points when Fed policy makers met Aug. 10. The five-year average is 0.50 percentage point, according to Bloomberg data.

Spooked yet?


Sunday, September 5, 2010

Quick Tip when back testing with EzBacktest

Finding ETF-s and mutual funds with a long history might be a challenge. It's advised to use alternatives which should generally provide same results. I found that vanguard's index mutual funds are a good replacement for ETF-s when I want to test a period beyond 10 years.

For example:

* Instead of SPY, I change the portfolio to invest in VFINX
* Instead of SHY/AGG etc, I change the portfolio to invest in VBISX

Now testing with a bull/bear strategy simulator - I get the following stunning result:
(Image above: setting up bull/bear simulation, image below: the results. Green triangle indicates bull signal and purchase of bull portfolio, pink X signals bear, star signals rebalance or other - visible through tool tip)

Could investing be this simple? Follow one simple signal and alternate between bull and bear portfolio? Try for your self - download the software and experiment with your desired allocations.


And I thought I knew programming threading...

It seems Microsoft went a few steps forward with the release of .Net 4, and have created a much more extensive parallel paradigm. I thought it was a parallel extension for loops and linq, but then I came across 'Task', and noticed Microsoft is recommending from here on to stop using Threads and ThreadPool, and instead use tasks:

             .NET Framework 4

The Task Parallel Library (TPL), as its name implies, is based on the concept of the task. The term task parallelism refers to one or more independent tasks running concurrently. A task represents an asynchronous operation, and in some ways it resembles the creation of a new thread or ThreadPool work item, but at a higher level of abstraction. Tasks provide two primary benefits:
  • More efficient and more scalable use of system resources.
    Behind the scenes, tasks are queued to the ThreadPool, which has been enhanced with algorithms (like hill-climbing) that determine and adjust to the number of threads that maximizes throughput. This makes tasks relatively lightweight, and you can create many of them to enable fine-grained parallelism. To complement this, widely-known work-stealing algorithms are employed to provide load-balancing.
  • More programmatic control than is possible with a thread or work item.
    Tasks and the framework built around them provide a rich set of APIs that support waiting, cancellation, continuations, robust exception handling, detailed status, custom scheduling, and more.
For both of these reasons, in the .NET Framework 4, tasks are the preferred API for writing multi-threaded, asynchronous, and parallel code.

I'm still more comfortable with the Visual Studio 2008 environment and am not porting my applications to yet more extensive .Net framework. But I am researching to allow future upgrades which should utilize the framework with the best practices. Continue reading about Tasks at MSDN:
Task Parallelism (Task Parallel Library)


Friday, September 3, 2010

200 year old beer discovered at bottom of sea

No sexy Bud/Coors commercials...

World's 'oldest beer' found in shipwreck
First there was the discovery of dozens of bottles of 200-year-old champagne, but now salvage divers have recovered what they believe to be the world's oldest beer, taking advertisers' notion of 'drinkability' to another level.

Though the effort to lift the reserve of champagne had just ended, researchers uncovered a small collection of bottled beer on Wednesday from the same shipwreck south of the autonomous Aland Islands in the Baltic Sea.

"At the moment, we believe that these are by far the world's oldest bottles of beer," Rainer Juslin, permanent secretary of the island's ministry of education, science and culture, told CNN on Friday via telephone from Mariehamn, the capital of the Aland Islands.

"It seems that we have not only salvaged the oldest champagne in the world, but also the oldest still drinkable beer. The culture in the beer is still living."

Juslin said officials had talked to a local brewer about whether the new-found beer might be able to yield its recipe after experts decipher the brew's ingredients.

The newest find came as divers unearthed bottles separate from the earlier champagne find. While lifting a few to the surface, one exploded from pressure. A dark fluid seeped from the broken bottle, which they realized was beer.

All the cargo on the ship -- including the beer and champagne -- is believed to have been transported sometime between 1800 and 1830, according to Juslin. He said the wreck was about 50 meters deep (roughly 164 feet) in between the Aland island chain and Finland.

The cargo was aboard a ship believed to be heading from Copenhagen, Denmark, to St Petersburg, Russia. It could have possibly been sent by France's King Louis XVI to the Russian Imperial Court.

"Champagne of this kind was popular in high levels [of society] and was exclusive to rich groups -- it was not a drink for common people then," Juslin said.

Experts estimated the exclusive bubbly to be worth tens of thousands of euros per bottle. The value of the beer has not been determined. It is also unknown whether the beer went flat while sitting at the bottom of the Baltic for such a long time.

Some of the bottles of champagne were originally produced by Juglar, a premium champagne house no longer in existence, according to Juslin.

He said the cold sea water was a perfect way to store the spirits, with the temperature remaining a near-constant 4-5 degrees Celsius (around freezing temperature in Fahrenheit, or 32 degrees) and no light to expedite the spoiling process.

I wouldn't drink it...thanks. Interesting that treasure hunters are still out there digging up - not gold - but beverages.