Weimar Moment Coming

Tomorrow the FED will, in all its inglorious righteousness, decide whether to print either $500 Billion or $ 1 Trillion in new fiat money to purchase securities. There's already been agricultural and commodity inflation (Think "food") for the better part of 2010. This will now send prices through the roof.

These idiots have absolutely NO EARTHLY IDEA what they're doing or what the consequences are. Sooner or later, our FED devalued greenback will filter down to the consumer.

Ron Paul, where are you when I need you? You're the only guy with the guts to be willing to abolish the Federal Reserve.

There is no such thing as a "free lunch". If you print money the way the Obama Administration has done (in addition to spending it foolishly), somebody is going to have to pay the Piper.

We can't get these idiots out of office fast enough.

UPDATE: As of Nov 3 2010 the FED has announced a new program where they'll print enough fiat money to purchase $600 Billion in Treasury and other debt. They are doing this because the Obama Administration has had 20+ months to "get it" and simply hasn't done so. The FED feels compelled to do "something".  Unfortunately, the FED's resources don't amount to much at this late stage of the game, and the end result will be virtually no economic stimulus at all, with almost guaranteed future inflation.

There is only one way out of this mess (that our European partners have long since discovered and implemented):
1) Stop Government spending. Reduce the size of government.
2) Lower tax rates across the board. Numerous academic studies have proven this to be effective. (By the way, that includes so-called  "Rich People").
3) Provide the business community with stability of expectations and remove the fear.
4) Provide massive tax credits and incentives to business to free up the cash they've been hoarding. Let business hire, create jobs and grow the economy, which is what it has done for the last 250+ years.
5) Above all, make sure the business community understands that these changes are PERMANENT. That is the only way to remove the uncertainty and get real job growth, once and for all.

Obama, after a massive blow on November 2, 2010, still doesn't get it. Too bad, pal.


New Silverlight Article

I posted a new article on Silverlight at eggheadcafe.com. This covers the use of Rene Schulte’s WriteableBitmapEx offering to create Hopalong Fractals.


Don’t Forget.


On September 11, 2001, fanatic Islamist extremists declared war on America.

They are still out there. They are determined to kill Americans. The rationale is not important when you are dealing with maniacs. There is only one choice: Eliminate them, so that they can never do it again.

ServicePeople: Your service to the United States is deeply appreciated. We owe you a deep debt of gratitude for your selfless dedication to protecting everything we believe in – freedom, liberty, and life. We won’t forget the sacrifices you and your families have made in defense of the American way.



Get File Length over http before you download it

This is one of those forum questions that you “think” you know the answer to, and then you’re proven wrong.
User wants to download a file from a remote site but they do not want to proceed with the download if the file is larger than 10MB. Make sense, right?
I said there was no way to do this without downloading the file. I was wrong. Here’s how he solved his own problem:
static void Main(string[] args)
string completeUrl = 
WebClient obj = new WebClient();
Stream s = obj.OpenRead(completeUrl);
Console.WriteLine( obj.ResponseHeaders["Content-Length"].ToString());
obj = null;

The above correctly reports the file size of 85,827 bytes without ever downloading the file!

Somebody had a problem. Instead of giving up (or worse, taking my so-called “expert advice”) he thought  “outside the box” and found a solution. I call that outstanding!

NOTE: At least one commenter pointed out that a HEAD request is the most efficient. That's true, but in my experience not all HEAD requests work on all sites so you actually may need to make 2 requests if the first one fails.


Don’t criticize – Be a Mentor

I tweeted this concept recently and got a very positive response.

As developers, business owners, partners, and gurus of various breeds, we are constantly exposed to situations where things other people do just don’t seem to fit our personal paradigm.

Sometimes, a natural reaction may be to put somebody down or make a sarcastic comment.

Don’t do it.

Environments like this create a situation where we can excel as developers, or we can turn them into a situation where we turn out to be a complete and total ass because of our behavior towards others.

No matter what the situation is, you can catch more flies with honey than with vinegar.

There is NEVER a situation where putting somebody down will further the effort – not in development, not in personal interactions, not in a group. Never.

What you need to do is step back, hold your breath, and think. Then, hopefully, you can find the resources in your inner being to respond in a positive manner.

The results, if you work on this process, will be nothing short of amazing. I guarantee it.


MongoDb NoRM MonoDevelop on Ubuntu Linux


This weekend I spent some time setting up Ubuntu Desktop on my Oracle VirtualBox. I installed MonoDevelop, and MongoDb.

I added an ASP.NET Web Application that uses the NoRM C# Driver, and after a little futzing (like changing the port on the MonoDevelop XPS web server) it built and ran great!

Interestingly, it was a  Visual Studio 2010 solution, but MonoDevelop was able to open it anyway. All I had to do is remove some of the references that “didn’t belong”, and remove the targetFramework attribute from the web.config.

Now that’s quite an accomplishment, since I am most definitely not a Linux guy. Kudos to the MonoDevelop guys. They’ve done a great job.

And it just shows how portable MongoDb really is. Being able to build and run .NET applications and  even ASP.NET apps on Linux is a big plus.



The more I use LINQ, the more I run into legacy code that can easily be improved. The nice thing about LINQ is that it can make your code more elegant and easier to understand, as well as, in most cases, more efficient.

Let’s take a simple  example. Here I’ve extracted some legacy code in the form of a method that tells you if a given string “Key” is present in a string array. First, the “OLD” way:
//"OLD" way:
static bool IsKeyInArray(string[] items, string key)
if (items == null) return false;
if (items.Length < 1) return false;
if (String.IsNullOrEmpty(key)) return false;
foreach (string item in items)
if (item.Trim() == key)
return true;
return false;

The obvious  thing to see here is that we have to iterate over the entire array. Now the new “LINQY” way:

static bool IsKeyInArray2(string[] items, string key)
bool isInArray = false;
if (items == null || items.Length <1 || String.IsNullOrEmpty( key)) 
return false;
if (items.ToList().Contains(key))
isInArray = true;
return isInArray;

Note that by simply calling the ToList() extension method, we’ve automatically converted our string array into a “LINQY” construct. No iteration needed, just use the “Contains( key)” method.


Don’t Make Other Developers Test Your Code

Yep! I run into this all the time.
Developers make changes and enhancements, and they think everything is fantastic.
They push it up into source control, and go home for the night.
But It’s not fantastic.
They don’t have unit tests to prove their code. The next morning, the other developer(s) update the code, and it breaks.
Then of course you get into the inevitable series of emails centering around “Hey – this doesn’t work!”
Here’s the deal: If you make changes to source code, you better have tests in place to prove that it works, and have run them and seen that they work.  They don't "have to be" fancy unit tests (although that's preferable). They just have to prove that whatever you did works.

Only then should you feel comfortable and confident that you can check in your code.

Anything less is completely unacceptable. Please DO NOT make me test your code for you!
Got it?


Lean up Windows 7 with Msconfig


Most people are blissfully unaware of all the absolute JUNK that gets run when Windows starts up, mostly due to registry entries installed by various programs, drivers, and what not.

Much of this junk can be safely disabled. You can use Msconfig to do it. Here’s how:

Hit the Windows Start button at the lower left side of your Taskbar. Click RUN, then enter “msconfig” and click OK.

You’ll see four Tabs – the one you want is “Startup”. You can start disabling items by unchecking them. Some items will be automatically reinstalled on the next startup by windows or by necessary drivers. But you can disable a lot, and that means less memory usage and less resource-hogging.

Here are the first two screens of mine:




You can see that I have most of it (from the first screen) and all of them (on the second screen) disabled, along with even more on the third screen (not shown).

I could care less about Adobe Updater, Itunes, Zune and whatever. If I need to run Itunes, I plug my iPhone into the USB, and run ITunes. It will say that the Apple Mobile Device Service is not running. So what do I do? I go into Services and start the booger, and everything is fine. I have it set to “Manual”.  I absolutely do not need this service running and hogging resources on my machine when I’m not updating my iPhone. Same with Zune and a hundred other useless programs including Google Update, which does not behave well even if turned off in msconfig (Are you listening, Google? How about lets make our stuff user-friendly?)

Lean up your machine. I guarantee, you’ll be a happier developer.


Developers: Monetize Your Content

Developers: Do you have a content-rich web site or blog?

Eggheadcafe.com has been in business for over 10 years. With over 10 Million pageviews monthly (and historically as high as 20 Million) we have learned “how to do it” – from Adsense to custom advertising, we’ve tested and proven virtually every approach that’s available. We know what works, and what doesn’t work.We make money.

If you have a website or blog with fresh technical content, consider a joint venture or an equity deal with us to monetize that content now!

We are in a position to consider any potential deal, no matter how small or large.

For details, email me at pbromberg at gmail dot com with some details in confidence.


Guess Which Countries Have Government-run Health Care

An  Investor's Business Daily article provided some interesting statistics from a survey by the United Nations International Health Organization (see citation at bottom):

Percentage of men and women who survived a cancer five years after diagnosis:

U.S.      65%
England 46%
Canada 42%
Percentage of patients diagnosed with diabetes who received treatment within six months:

U.S.       93%
England 15%
Canada 43%

Percentage of seniors needing hip replacement who received it within six months:

U.S.      90%
England 15%
Canada 43%

Percentage referred to a medical specialist who see one within one month:

U.S.       77%
England  40%
Canada  43%

Number of MRI scanners (a prime diagnostic tool) per million people:

U.S.      71
England 14
Canada 18

Percentage of seniors (65+), with low income, who say they are in "excellent health":

U.S.     12%
England  2%
Canada  6%

I don't know about you, but I don't think I want "Universal Healthcare" comparable to England or Canada. Moreover, it was Sen. Harry Reid who said, "Elderly Americans must learn to accept the inconveniences of old age."

He is "elderly" himself, but be sure to remember his health insurance is much different from yours as Congress has their own high-end coverage! He will never have to learn to accept inconveniences. The fact of the matter is that "some" participants in both Canada's and Britain's systems get excellent care, but many do not. The overall figures don't lie.

Makeup of the Cabinet

The percentage of each past president's cabinet who had worked in the private business sector prior to their appointment to the cabinet. You know what the "private business sector" is... a real life business, not a government job. Here are the percentages:

T. Roosevelt........ 38%
Taft................      40%
Wilson .............    52%
Harding............  . 49%
Coolidge............  48%
Hoover .............  42%
F. Roosevelt......  50%
Truman.............. 50%
Kennedy...........  30%
Johnson............  47%
Nixon...............  53%
Ford............... . 42%
Carter..............  32%
Reagan............  56%
GH Bush.........  51%
Clinton ............ 39%
GW Bush......... 55%

And the winner of the Chicken Dinner is:
Obama..... 8%!

Yep! That's right! Only eight percent -- or possibly as high as 20%, depending on whose work you are studying -- but still the least by far of the last 19 presidents. And these people are trying to tell our big corporations how to run their businesses? They know what's best for GM... Chrysler... Wall Street... the health care complex -- and you and me? This is your progressive Liberal agenda at work.

How can the president of a major nation and society -- the one with the most successful economic system in world history -- stand and talk about business when he's never worked for one? Or about jobs when it appears that up to  92% of his senior staff and closest advisers have spent most of their time in academia, government and/or non-profit jobs.

Incidentally, the moment you publish this information (which is puported to be "fake") you are bound to get responses. I should mention that the information is from a May, 2009 Investors Business Daily article which itself is based on information from Rep Mark Kirk (R-IL), which his office compiled from a variety of valid sources:

The Cabinet data was originally presented by Michael Cembalest in an article in Forbes:

Cembalest later admitted to some inaccuracies, but the overall thrust of his work is valid.
The information is not "fake", it is actually fairly well-researched. It's just that it has traveled around the Net in what some consider a slanted format that they find particularly difficult to digest.

Incidentally, I often get blog comments to the tune of “you should stick to coding issues”, indicating that my political views are distasteful to the commenter. I started this UnBlog a long time ago, and since the day of it’s inception, the Masthead has stated “Pete’s views on .NET, Politics, and Everything else that’s wrong in the world”. I write about what I think is interesting or important, and above all, I try to get people to THINK. I almost always approve comments that oppose my view, unless they are outright ad-hominem attacks. Do you disagree with what I have to say? I respect your opinion.


Install Windows Server 2008 R2 and Sharepoint 2010 on a VM

"Politicians and diapers should be changed frequently, and for the same reason." — Eça de Queirós (Portuguese writer)

For a couple of months now I’ve tried to install Server 2008 R2 (which only comes in the 64-bit flavor) and Sharepoint2010 on a virtual machine so that I could conveniently study SharePoint without all the extra resources hogging my regular development box.

The first thing you learn is that Windows 7 Virtual PC will not handle a 64-bit guest operating system, not even if It’s the x64 version installed on an x64 box. Drats, Microsoft!

Then you learn that VMware is somewhat bloated in that it  installs a lot of extra driver-type baggage, so I gave up on that.  And, I still had issues installing Server 2008 R2 on that. Plus it’s not free, although I do know that they do have a “free” Player version, to their credit.

And then you learn that “supposedly” you can trick Windows 7 x64 into accepting an installation of SharePoint 2010 – but the fixes are so convoluted and error-prone, I gave up on that too.

Finally, I looked at Oracle Virtual Box – which comes in x86 and x64 flavors for a number of different host operating systems. Installation is a breeze. Installation of Server 2008 R2 into the VM was a breeze (you have to use the Windows 7 x64 profile). And installing SharePoint 2010 is a breeze! Virtual Box is free for commercial and personal use; in fact it’s open source and there’s even a developer SDK if you want to create your own product from it. Oh – and in case you missed it – Virtual Box is FREE.

The whole thing works great; it comes out of hibernation fully booted in about 10 seconds. I’m so pleased that I’m currently RAR-ing the whole VM so that I can have a copy on my x64 notebook PC too!

NOTE: If you are having an issue with VirtualBox (or any VM)  booting with an x64 OS, make sure that “Hardware Virtualization Technology” – or whatever your computer manufacturer calls it – is enabled in your BIOS setup, and reboot.



1932, Anybody?

Robert Reich, former Labor Secretary and known Liberal, writes on his blog, “The economy is still in the gravitational pull of the Great Recession. All the booster rockets for getting us beyond it are failing”.

Looks like at least some Liberals are starting to “get it”.

Home sales are down. (New home sales, the lowest in recorded history!) Retail sales are down, and factory orders suffered their biggest decline since March of last year. So what are we doing about it? "Less than nothing," says Reich on his blog.

For the second time in two years, Arnold Schwarzenegger has ordered most state workers' pay cut to the federal minimum wage because lawmakers missed their deadline to fix the state's $19 billion budget deficit. The Legislature's failure to act has left the state without a spending plan as the new fiscal year begins. Other states are approaching this Greek-style debacle.

Total nonfarm payroll employment declined by 125,000 in June. About a million Americans have COMPLETELY dropped out of the job market over the past two months. That is the only reason why the statistical unemployment rate is not soaring to a post-war high, and is stuck in the 9.5% range. Let’s not forget that it takes 125,000 real new jobs every month – just to keep up with population growth. The latest "job creation" numbers were something like 82,000! Stimulus, my butt!

Let’s deal with reality: the US is still trapped in depression after a full 18 months of virtual zero interest rates, quantitative easing, and huge fiscal stimulus (mostly directed in all the wrong places) that has pushed the budget deficit to unsustainable levels. Keynes must be rolling his eyes and giggling from the grave!

In order to finance this huge gap between federal income and spending, the Obama administration will mostly follow the path of the previous administrations, and it is expected that outstanding public debt will reach some $18.5 trillion by 2020, essentially doubling in a decade, which equates to more than 100% of GDP by the numbers of today.

This approaches the astronomical values registered in Japan since the aftermath of the 1989 stock market crash. In case you don’t remember, the Japanese economy subsequently went nowhere for the next 10 or 11 years. Clearly, based on recent experiences in the EU, this is completely, utterly unsustainable.

The count of people who are unemployed but not receiving a check is now something like 9.2 million.

On Friday, Jacques Cailloux from RBS put out a "double-dip alert" for Europe. "The risk is rising fast. Absent an effective policy intervention to tackle the debt crisis on the periphery over coming months, the European economy will double dip in 2011," he said. Notice how Mr. Cailloux refers to the "European Economy" in the same sense as one would describe the "American Economy". What it really is, however, is a collection of member states in various stages of fiscal stability, all sharing a single currency - to the great alarm of some of them. The decision to have a single Euro fiat currency could very well have been one of the great financial blunders of the last 100 years.

The current occupant of the White House claims to know how to create jobs. He claims jobs have been created. This is the same fellow who recently preached “recovery” in Racine – which has a 14% unemployment rate!

Meanwhile, the government has kept the union workers of GM and Chrysler employed (with taxpayer money), made sure that most government employee union members got their annual raises for sleeping on the job (with taxpayer money). And Obama has made sure that major campaign contributors collected billions off government stimulus (with taxpayer money). Fannie and Freddie ( thanks in part to our friends Barney Frank and Chris Dodd) with billions pouring into the Bailout Black Hole (again, at taxpayer expense). This printing of huge quantitities of money and shoveling it into the gaping mouths of failed zombie institutions does nothing. They just keep coming, with their arms outstretched, "Feed Me!" It would be cleaner to just flush all this money down the toilet! Dismantle the Zombies, sell off their parts, and let them finally die.

ESPN Zone just closed all their restaurants across the country. If they can't make it selling cheap food and beer with 100 big screens blaring every sporting event on the planet to a sports-crazy society, we are in trouble.

Small businesses don't have the power to impose taxes or print money. So unlike government, we'll just have to cut employees and run lean and mean – or go out of business.

At the recent G20 summit in Toronto, Obama pushed for other governments to continue to print money – and, surprise -- they refused. How long is it going to take, after 18 months in office, for these Chicago Progressive Liberals to understand that you simply cannot create jobs by printing money? What are we talking here, Greek?
The days of believing the Obama propaganda about a jobs recovery are over. The trillion-dollar corporate handouts (called "stimulus") may have kept big business in the money for the past 18 months, and artificially propped up the stock market, but small business is the real bellwether of what’s happening. Small Businesses aren't growing and investing (corporate cash is at an all-time high), and they aren't hiring - partly because they're fearful about the huge tax burden - capital gains taxes, estate taxes, and costs of the multi-trillion dollar ObamaCare plan that businesses will need to comply with.
So who is going to pay Obama's taxes? Not his voters. They want government to pay them! Who is going to create Obama's jobs? Not his voters -- they've never created a job in their lives. It’s small business that creates 80% of the jobs in this country. When we stop printing money and start giving incentives to small business to invest and create jobs, we’ll see a real recovery. Don’t hold your breath – at least not until November.
Yes, there is only one solution: Vote these morons out, and replace them with people committed to fiscal responsibility, once and for all. And I mean REAL fiscal responsibility – the kind you and I understand perfectly well when we balance our checkbooks!
There’s no free lunch. Not in politics or economics. And it’s all coming back to bite us, big time! Figure it out.


Less is More Redux

In my short happy life as a developer, I’ve run into all kinds of development efforts that include frameworks, libraries, web sites, and much more.

The one thing that stands out as an irritant to me is complexity. Specifically, unnecessary complexity. I’ve seen developers author entire library assemblies that provide wrapper utility methods consisting of calls to .NET BCL methods that take one line of code – methods that could have been called inline without even the need for the “helper” classes.

I’ve seen frameworks that duplicate code that is already present in the .NET Framework, usually because the developer didn’t know they already existed (e.g., writing your own “connection pool” when the providers already expose a perfectly fine one).

I’ve seen frameworks with layer upon layer of interfaces, base classes, derived classes and convoluted, multiple code paths that are inefficient and slow down execution because the developers kept building and building on top of something that wasn’t designed with simplicity in mind in the first place.

And of course, the Granddaddy, using exceptions to handle business logic. Don't do it! The vast majority of the time, as long as you can find out why an exception would be generated, you can code defensively to prevent it and avoid burning up a whole bunch of useless CPU cycles. And believe me, that is precisely what exceptions do.

The subcorollary of the above, of course, is the empty Catch Block, which, if you are not the original developer who put it in, can drive you mad since it completely SWALLOWS exceptions. Bad, bad, bad!

Einstein said, “Everything should be made as simple as possible, but not simpler.”

Bill Wagner, in his excellent book, “Effective C#” Second Edition (which I reviewed here), gives a good example in his “Item 11 – Understand the Attraction of Small Functions”:

Bill says that one of the most common examples of premature optimization is when you create longer, more complicated methods in the hope of avoiding method calls.

The .NET Runtime performs JIT compilation on a method – by – method basis at runtime, as the methods are used. Methods that do not ever get called don’t get JITed. Bill gives a short example:

public string BuildMsg( bool takeFirstPath )
StringBuilder msg = new StringBuilder( );
if ( takeFirstPath )
msg.Append( "A problem occurred." );
msg.Append( "\nThis is a problem." );
msg.Append( "imagine much more text" );
} else
msg.Append( "This path is not so bad." );
msg.Append( "\nIt is only a minor inconvenience." );
msg.Append( "Add more detailed diagnostics here." );
return msg.ToString( );

The first time BuildMsg gets called, both paths are JITed, but only one is needed. But if you rewrote the method this way:

public string BuildMsg( bool takeFirstPath )
if ( takeFirstPath )
return FirstPath( );
} else
return SecondPath( );

-- the body of each clause has been factored into its own method, and that method can be JITed on demand rather than the first time BuildMsg is called. The example is deliberately short and contrived, but think about how you code: Do you write code with 20 or more statements in each branch? How about switch statements where the body of each case block is defined inline instead of in separate methods?

Smaller, simpler methods make it easier for the JIT compiler to support enregistration, which means you get more effiicient compiled code that runs faster.

There is no "free lunch" in .NET programming. You can write code that is convoluted and complex, and poorly engineered. It can even have misspellings and grammatical errors - and if they are consistent throughout, the compiler will not complain. Yes, your code may compile and run. But did you do right? NOT!

I’ve seen developers approach a concept in either of two general ways:

1) Build a simple, basic prototype, allowing for extensibility but start out with a small, manageable concept. Then test it, work with it, and continue to build it out – if needed or desirable.

2) Engineer the “Big Vision” – working on everything at once, and don’t deploy it until it’s complete.

Of the two, I much prefer the smaller “Less is More” iterative prototype approach. I think it is safer, and less prone to errors that may be difficult to undo later due to over-engineering or poor design.

Developers can learn about programming from reading Ernest Hemingway. He was a master at the short sentence, and would often throw away dozens and dozens of typed pages until he finally settled on one that he was happy with. His distinctive writing style, characterized by economy and understatement, can serve as a literary model for what programmers "should' be doing when they design and write code! Less is more! For an example try this for size.

I once worked on a large healthcare .NET application as a contractor in Atlanta. The manager there was a funny guy. He would walk around saying “Simplify, Simplify, Simplify!”. He was right.


Addicted to Oil

30 years ago, Brazil imported 80% of its oil. With a strong sense of purpose, Brazil invested heavily in bio-fuel technology and refocused its transportation energy towards a resource Brazil could manufacture internally—sugar based ethanol. Today, Brazil uses flexible fuel vehicles that can run on gas, ethanol, or any combination of the two. It still has a mandate to be 100% independent of oil in 2011.

Yes, Brazil still drills for oil, and they still use it - plenty of it. But at least they've had a plan for upwards of 30 years now. We have virtually none by comparison.

If the President had some guts and some vision (like Kennedy did when he said we'd put a man on the moon in the next 10 years) and said "We're getting off oil by 2021", could we do it? Of course we could. It would create huge numbers of jobs, and it would deny billions in revenue to foreign producers many of whom DO NOT LIKE AMERICANS.  But, there's no vision, and no guts. And it is not likely we’ll see any of either in this term of office.

Obama's campaign rhetoric has promised us all kinds of wonderful things - however did we manage to get through the first 250 years without Barack Obama to beat some progress out of the terrible corporations that have been holding us back?  Hold our “Boot to the neck” of BP? Come on, people. The President is “furious” about the Gulf Oil Spill? Give me a break.

The United States has ethanol (#1 producer in the world) and natural gas (#6 in natural gas reserves), so transitioning to another fuel is not some mythic task beyond our abilities. It is only the oil companies that want to hold us back. If we issue the challenge, set ourselves to the task, and focus our American ingenuity and commitment, there is no reason we cannot make rapid strides that will create jobs in our country and stop sending our cash to the Middle East. Unlike putting men on the moon, this is not rocket science for us, either. It simply takes some resolve, a plan, and some guts. We already possess ample technology to get off of oil.

There's a lot of talk about imposing tariffs on imported ethanol from Brazil. The only thing we should be importing from Brazil is their resolve to become energy independent. Domestic ethanol is cheaper than imported ethanol, and it is far cheaper than gasoline refined from imported oil. The truth is that we have to end our reliance on foreign energy – period. Domestic ethanol helps create U.S. jobs, and helps the U.S. economy, and strengthens our national security by reducing our dependence on foreign energy.

The problem  here is that we are simply - ADDICTED TO OIL. And like any addict – whatever the drug – if it remains available, there’s no incentive to go through the pain of withdrawal.  Only leaders with exceptional vision, drive and sheer balls can do what President Kennedy did. Unfortunately, none of these qualities seem to be  present here now.


A Layman’s Explanation of The Derivatives Market and Crash


This was passed on to me by a good friend, and I found the analogy so compelling that I decided to share it:

Heidi is the proprietor of a bar in Detroit . She realizes that virtually all of her customers  are unemployed alcoholics and, as such, can no longer afford to patronize her bar. To solve this problem, she comes up with new marketing plan that allows her customers to drink now, but pay later.

She keeps track of the drinks consumed on a ledger (thereby granting the customers loans). Word gets around about Heidi's "drink now, pay later" marketing strategy and, as a result, increasing numbers of customers flood into Heidi's bar. Soon she has the largest sales volume for any bar in Detroit. By providing her customers' freedom from immediate payment demands, Heidi gets no resistance when, at regular intervals, she substantially increases her prices for wine and beer, the most consumed beverages.

Consequently, Heidi's gross sales volume increases massively. A young and dynamic vice-president at the local bank recognizes that these customer debts constitute valuable future assets and increases Heidi's borrowing limit. He sees no reason for any undue concern, since he has the debts of the unemployed alcoholics as collateral.

At the bank's corporate headquarters, expert traders proceed to transform these customer loans into DRINKBONDS, ALKIBONDS and PUKEBONDS. These securities are then bundled and traded on international securities markets. Naive investors don't really understand that the securities being sold to them as AAA secured bonds are really the debts of unemployed alcoholics. But underwriting insurers have guaranteed them and so they must be as good as gold, having been rated “AAA”.

The bond prices continuously climb, and the securities soon become the hottest-selling items for some of the nation's leading brokerage houses. One day, even though the bond prices are still rising, a risk manager at the original local bank decides that the time has come to demand payment on the debts incurred by the drinkers at Heidi's bar. He so informs Heidi.

Heidi then demands payment from her alcoholic patrons, but being unemployed alcoholics they cannot pay back their drinking debts. Since Heidi cannot fulfill her loan obligations, she is forced into bankruptcy. The bar closes and the eleven employees lose their jobs.

Overnight, DRINKBONDS, ALKIBONDS and PUKEBONDS drop in price by 90%. The collapsed bond asset value destroys the bank's liquidity and prevents it from issuing new loans, thus freezing credit and economic activity in the community.

The suppliers of Heidi's bar had granted her generous payment extensions and had invested their firms' pension funds in the various BOND securities. They find they are now faced with having to write off her bad debt and with losing over 90% of the presumed value of the bonds.

Her wine supplier also claims bankruptcy, closing the doors on a family business that had endured for three generations, her beer supplier is taken over by a competitor, who immediately closes the local plant and lays off 150 workers.

Fortunately though, the bank, the brokerage houses and their respective executives are saved and bailed out by a multi-billion dollar no-strings attached cash infusion from the Government. The funds required for this bailout are obtained by new taxes levied on employed, middle-class, non-drinkers.

Now, do you understand? There is no such thing as a free drink, or a free lunch. Look at the European Union, pumping in $1 Trillion of fiat printed Euros in order to save Greece, and understand that the United States isn’t that far behind.

In 2009, the FDIC closed 140 banks – a rate of 11.66 banks per month. As of the end of May 2010, the FDIC has already closed 74 more banks – an increase to a 14.8 bank closure per month rate. And that, friends, is not some analogy. It’s FACT.

Are there too many Heidi’s Bars – or just too many really dumb bankers? Or perhaps – the Government is simply run by a cadre of unemployed alcoholics?


Upgrading to WCF RIA Services v1.0 and Ria Services Toolkit

The kind folks on the Silverlight and RIA Services teams have come out with v1.0 of RIA Services. However, the instructions they provide can be a bit misleading as to “What does what”.

Here’s the skinny:

1) You can download the Silverlight 4 Tools installer, dated 5/13/2010 here. This will uninstall previous interim versions of the SDK, runtime and RIA Services – you do not have to uninstall anything before running it.

2) However, the above WILL NOT refresh the RIA Services Toolkit. That you must uninstall first, and then run the new Toolkit installer, dated 5/14/2010, which is here.

I like the Web Platform Installer, but you can never be absolutely sure what exactly you are getting with it because the installation process is much more opaque than using an MSI installer file. If you use the above two steps, you are pretty much guaranteed to be 100% up to date!

And don’t forget – you can run the tools installer from a DOS prompt with the /x option to extract everything to the folder of your choice and see exactly what you’re getting:  Silverlight4_tools.exe /x


Club Med and the Lessons of History (or, What am I talking, Greek?)

GREEK CRISIS: A serious debt crisis in Greece has rattled global financial markets and raised worries about whether other countries will be able to repay their debts.

LEHMAN REPLAY: Economists are worried that the Greek crisis, if not contained, could turn into a repeat of the cascading financial panic that occurred in the fall of 2008 after Lehman Brothers collapsed.

DEBT RESCUE: European countries and the International Monetary Fund are racing to assemble a package of loans for Greece that will be sufficient to convince markets that the country will not default on its debt obligations.

Concerns have already surfaced in Congress that the broad demands of the sovereign debt crisis will quickly exhaust the I.M.F.’s reserves and leave the United States, the fund’s largest shareholder, with the bill.

Professor Nouriel Roubini, the New York-based academic who was one of the few to anticipate the scale of the US financial crisis, told a panel in California that the buildup of debt is likely to lead to countries defaulting or resorting to inflation to ease the burden on their populations.

“While today markets are worried about Greece, Greece is just the tip of the iceberg,” he said., “ The thing I worry about is the buildup of sovereign debt.”

The whole idea that the financial crisis was over is being called into doubt. History shows us  that the Great Depression bottom was the sovereign debt default phase. And the EU's erratic responses (hesitancy followed by “lip service” rather than decisive responses) is going to prove even more detrimental as this "Club Med" crisis grinds on.

The Great Depression was composed of two separate panics.  In 1930 people thought they'd seen the worst of things. 

But the economic conditions created by the first panic were already eating away at the foundations of financial institutions and governments.   This is one of the reasons that we had a second banking crisis, which pushed America to the real bottom of the Great Depression, and brought FDR to power.

The euro is in crisis, and already-weak European banks appear to be massively exposed to Greece's huge debt load.  They're even more exposed to the debt of the other Eurozone countries – Spain, Portugal et. al., which is far too large for it all to be bailed out.  The size of the rescue package that Greece needs is already going to take a substantial chunk of the IMF's war chest. And the IMF is, basically, the United States.

It's not clear that Greece has the political will for the austerity measures it's going to have to make even if its debt yields come back down--and the higher they stay, the smaller the chance.  This is  the calculation its creditors are making, which is why yields are now in the 20% range.  And, perversely, this  makes it more likely that creditors are going to lose their money.

A friend of mine from California, who is a successful investment manager and a multi-year disciple of Warren Buffet, thinks the entire idea of the Euro is idiotic: a fiat currency held by all members of the club.

Robert says, “In the “old days”, Greece could simply have devalued the drachma. Now, of course, they can’t devalue and so the reality of a “social democracy” such as the European Union is now exposed. In fact, what you have is an entire European Union that has borrowed from the future.”

The demographics are such that the concept of “ Europe ” per se is completely moribund. There is no future for Europe under the present circumstances.

Just as Greece is unwilling to undertake “austerity measures” ( i.e., stop borrowing and living on credit) the culture of Europe (which includes Great Britain but excludes Russia) is unwilling to do what is necessary; which is:

1.Unplug the Euro and return to sovereign currencies.
2.Stop all forms of deficit spending  (as in “do not spend more than you take in”)
3.Start procreating so that the population replacement ratio is reached  (which may be impossible, as well as too late).

Robert continues, “Thus, the IMF (read,  “USA” ) will ultimately bail out Greece since the Germans see the obvious injustice of raising taxes in Germany to pay for the profligate Greeks. In the USA, we are too stupid to see this, so Obama and Company ( the Idiot Geithner, The Fool Summers, etc) will, for political reasons, continue to raise taxes until all of the expendable income of the upper 5% is attached to support causes like the IMF (internationally) and Big Government (Unions, healthcare, etc) domestically.'”

The same morbidity applies to us except that, for the moment we are still standing (albeit not very tall).

You know what? I think my friend is right. We’ve got a very big problem on our hands, and we are indeed headed for a real double-dip recession. We’ve built a global house of cards. If that house comes down, it’s going to be very painful for a long, long time. How about it, Keynesians? Don’t tell me you plan  to print even more money to solve the world’s economic problems, because IT DOESN’T WORK.


Obscene Wealth – Myths About Capitalism

Recently I tweeted a quote from John Stossel (who was quoting Michael Medved):

"If you believe that when the rich get richer, the poor get poorer, then you believe that creating wealth causes poverty, and you're an idiot"

This is the old zero-sum fallacy, which ignores that when two people engage in free exchange, both gain -- or they wouldn't have traded. That’s the way business works.

I received a number of responses to that tweet, mostly espousing the leftist concept that Capitalism is bad and somehow that the concept of getting wealthy is “obscene” and it seems to occur “at the expense of others”.

When does wealth (or the creation of wealth) become "obscene"? Is there some measuring stick we can hold against it with a red line on it that says "Obscenity Level"? Or is it just somebody's subjective, biased jugement?

Other responses seemed to focus on the "deductive argument" logic of the statement, completely ignoring the point (and further indicating the difficulty some people seem to have with this concept)

One only needs to look at the recent recession to see the corollary that when the rich get poorer, the poor certainly don’t get richer.

Then there are those who claim, for example, that Walmart comes in and wipes out local grocers and other businesses. Obscene Wealth? Maybe, but they also bring new jobs to the community. That’s capitalism. If you try to regulate this kind of thing, you don’t make any improvements. All you do is create more Socialism and Collectivism – the hallmarks of the current Obama Adminstration. More regulation, more big government programs and agencies, and printing five times more money in one year than predecessor Bush did in two terms of office. Not that Bush was any angel- he almost singlehandedly dismantled Reaganomics, virtually assuring an economic collapse of one sort or another.

The bottom line is, this is one of the biggest lies -- the idea that because of capitalism, we're all suffering. Poor people in America today -- people who are officially in poverty -- have a higher standard of living in terms of medical standards, the chances of going to college, the way people live -- than middle-class people did 30 years ago. It's an extraordinary achievement of technology and of the profit sector, and it comes from the creation of wealth by hard - working entrepreneurs.

Here’s the thing: Capitalism works. It’s worked just fine in the US of A for over 250 years. If it ain’t broke, then don’t try to fix it.


Internet Explorer: Flash "1 item remaining" - Movie Not Loaded

A couple of days ago I started having an issue where if I’d go to Youtube.com to look at a Flash movie, I’d get to see only a black screen in the movie area. A right – click on the movie and I’d see “Movie not loaded”. In addition, the browser status bar reports “1 item remaining” – basically meaning, “I’m waiting for this movie to load”. Of course, this never goes away.

You might be tempted to uninstall the Flash plugin or try any number of fixes including changing your Internet Explorer security settings, among other "tricks". Don't do it. Try this first. Here’s how I fixed it:


In Internet Explorer, choose “Tools / Internet Options”. In the Browsing History section, click the “Delete” button and you should see a dialog like the above. Note that I have checked the History and Temporary Internet files checkboxes. Click Delete at the bottom and that should fix it. If that doesn’t work, do it again but this time uncheck the “Preserve Favorite website data” Item and click Delete again.

Works for me!


Fix Uninstall Issues with Visual Studio Versions

Have you ever installed a BETA or CTP or an RC build of some Microsoft product such as Visual Studio, and then been faced with the unhappy situation that it could not find the installation sources when you attempted to uninstall the product, or it just didn’t uninstall “cleanly” – leaving traces of Registry entries that prevented you from installing a later version?

It’s certainly happened to me several times. But today I ran into a program called Perfect Uninstaller that, for $35, turned out to be one heck of a bargain. Perfect Uninstaller has three modes to completely and totally uninstall any program.

It starts out using the regular Windows Installer, but it doesn’t stop there – even if the installer says “I can’t find the MSI source for this”, it doesn't give up like the Windows MSIEXEC installer would do -- it picks up all the Registry Entries by scanning the Registry, and then it picks up all file traces by scanning the filesystem.

The result is a 100% complete and total uninstall of the most difficult programs – programs for which the sources may be long gone and extremely difficult to find. I don't usually make it a practice to "promote" some piece of software, but in this case I'm going to make an exception. This thing works, and it works well!

Today I used Perfect Uninstaller to remove at least 10 different components of a previous Visual Studio BETA build that up to now absolutely refused to go away, and it worked flawlessly on every single one.

If you like to live on the edge and install beta software on your primary development machine, or you just have errant software that you cannot seem to get rid of, then this little proggie is for you!

I’m now a happy camper! Go try Perfect Uninstaller yourself. Dr. Dotnetsky sez, “This one really works!”. You'll thank me later.

A final note: On Monday, April 12, Visual Studio 2010 RTM will be launched at the Bellagio in Las Vegas. My MVP Lead P.J. Forgione has a post describing what some MVPs are doing at the launch event and around the world. MVPs who will be speaking at the event include Billy Hollis, Brian Noyes, Brian Randell, Carl Franklin, Christian Wenz, Dan Wahlin, Hadi Hariri, Joel Semeniuk, Jon Flanders, Juval Lowy, Scott Allen, Kathleen Dollard,Mark Miller, Markus Egger, Michele Bustamante, Paul Litwin, Richard Campbell, Richard Hundhausen,
Rockford Lhotka, Shawn Wildermuth, Steven Borg, Steven Smith, Tim Huckaby, Todd Anglin and Bob Beauchemin. I don’t know how many of these folks will need this Perfect Uninstaller thing like I did, but they all deserve a round of applause, because Visual Studio 2010 really rocks!


Session and Cache are By Reference

Recently a colleague remarked that if he got a List of some type out of the ASP.NET Cache, and changed an item, the Cache item would also change.

That is correct. Session (InProc) , Cache and Application all return "live" references. A good writeup on this can be found by friend and fellow MVP Rick Strahl here:

If you do not want this behavior, you need to either delete the Session / Cache / Application object and replace it with what you want later, or store a clone by duplicating the object, doing your work on the original that you got out of Cache, then replacing the existing cached item with your clone that was not changed.

for example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CachebyRef
public class Person
public String FirstName { get; set; }
public String LastName { get; set; }

public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
List list = new List();
list.Add(new Person(){FirstName="Joe",LastName = "Blow"});
Cache["personList"] = list;
List newList = (List) Cache["personList"];
Person p = newList[0];
Response.Write(p.FirstName + ": " + p.LastName + "<br/>");
p.FirstName = "Altered";
p.LastName = "State";
List altList = (List) Cache["personList"];
Person q = altList[0];
// Surprise - the cached item contains the change:
Response.Write(q.FirstName + ": " + q.LastName);


When Job Growth Is Not Job Growth

The Department of Labor just reported that in February, employment fell by fewer-than-expected 36,000 jobs with the unemployment rate steady at 9.7%.

While we may hear the Obama Administration or Harry Reid trying to spin this as some sort of economic victory for their stimulus or otherwise trying to put the best face on the economy, this is in reality not very good news.

Let us remember that job growth needs to be around 125,000 jobs gained per month just to keep up with US population growth. To make up the roughly 10 million jobs it would take to get us to an employment situation about where we were near the peak of the economy, we'd have to see job growth of 350,000 per month for four years straight. Such a scenario seems unlikely while we live under the umbrella of the Obama-Pelosi-Reid cartel. The Obama Administration has quintupled, in just one year, the deficits that took its predecessor Bush eight years to create.

Looking at the current stagnation in employment, in large part due to the Obama Administration’s policies, it would not be surprising to see unemployment remain high until Obama’s term in office ends. Things could improve somewhat if the GOP takes back at least one house of Congress in November. Right now, it looks like unemployment will remain above 9% when we reach November’s elections and if it falls under that level, it will be offset by a large increase in discouraged workers who are not counted in the numbers because they’ve just given up looking.

Once again, the failed Keynesian tactics of having the government create and spend huge amounts of money, increasing the deficit to an unsustainable level in the vain hope that this will create jobs, simply does not work.

In an October 2009 study, Alberto Alesina and Silvia Ardagna of Harvard looked at large changes in fiscal policy in 21 nations in the Organization for Economic Cooperation and Development. They identified 91 episodes since 1970 in which policy moved to stimulate the economy. They compared the policy interventions that succeeded — those that were followed by robust growth — with those that failed.

They found that successful stimulus relies almost entirely on cuts in business and income taxes. Failed stimulus relies mostly on increases in government spending. These are facts. They cannot be replaced by ideology, no matter how inspired it may seem.

There is a small amount of hope: A $15 Billion jobs bill was just passed: The centerpiece of the Senate HIRE Act is $13 billion in incentives for private sector businesses to boost hiring in 2010. The incentive, called the "Hire Now Tax Cut" by its original Senate sponsors, combines payroll forgiveness for Social Security taxes paid on qualified new hires, along with a tax credit for then keeping them on the payroll for at least 52 weeks.

The problems I see here are that it is too little, and too late. In addition, the incentives are flawed – business gets the incentive only by hiring somebody who’s been out of work at least 60 days. In other words, we are incentivizing business to hire the less qualified.

Incidentally, I’ve been getting some static recently by self-appointed economic gurus that Ronald Reagan was an idiot and created the biggest tax increase in history. We know from official economic statistics that the seven year period from 1982 to 1989 was the greatest, consistent burst of economic activity ever seen in the U.S. In fact, it was the greatest economic expansion the world has ever seen - in any country, at any time.

When you add up the record of the Reagan years, up to and including the first year of President Bush - during which he faithfully continued Mr. Reagan's economic policies - the conclusion is clear, inescapable and stunning: America's Great Expansion, which lasted some 25 years until George Bush the Younger began dismantling it. Obama came in and finished the job. Once again, I say that Reagan “got it”. Flame me if you will, the facts don’t lie.

Until an Administration starts to look at the facts instead of attempting to "make its own history" with some preconceived progressive agenda, not much will change. Lyle Rossiter, in his book “The Liberal Mind” explains that modern Liberalism rejects the competence and sovereignty of the common man and subordinates him to the will of governments run by liberal elites. The rise to power of this liberal agenda has resulted from the belief that the state is a proper source from which to gratify the longings of the people for various forms of parental care.

There are some signs that America may grow out of its infantilism e.g., the Tea Party movement – but it will take time.


String.Empty vs “” vs String. IsNullOrEmpty

I was reading up on this recently and a couple of interesting points came to light:

myString = “” creates a new instance of type String.

myString = String.Empty does not.

The key item is doing comparisons. Here’s some sample test code:

class Program {
static void Main(string[] args)
String myString = "";
long a, b, c, d, e, f;
Console.WriteLine("Method 1...");
a = DateTime.Now.Ticks;
for (int index = 0; index < 100000000; index++)
bool isEmpty = myString == "";
b = DateTime.Now.Ticks;
Console.WriteLine("Method 2...");
c = DateTime.Now.Ticks;
for (int index = 0; index < 100000000; index++)
bool isEmpty = myString.Length == 0;
d = DateTime.Now.Ticks;
Console.WriteLine("Method 3...");
e = DateTime.Now.Ticks;
for (int index = 0; index < 100000000; index++)
bool isEmpty = String.IsNullOrEmpty(myString);
f = DateTime.Now.Ticks;
var Method1 = b - a;
var Method2 = d - c;
var Method3 = f - e;
Console.WriteLine("Method 1: bool isEmpty = myString == \"\" took {0} ticks", Method1);
Console.WriteLine("Method 2: bool isEmpty = myString.Length == 0; took {0} ticks", Method2);
Console.WriteLine("Method 3: bool isEmpty = String.IsNullOrEmpty(myString) took {0} ticks", Method3);

The results:

Method 1: bool isEmpty = myString == "" took 4836000 ticks
Method 2: bool isEmpty = myString.Length == 0; took 2340000 ticks
Method 3: bool isEmpty = String.IsNullOrEmpty(myString) took 3744000 ticks

Bottom Line? The consensus among at least 4 or 5 expert Tweeters who commented was, IsNullOrEmpty is worth the extra ticks to test for null, even with 10 million iterations in the test!

Note: At the request of Todd Spatafore, I did a Visual Studio 2010 .NET 4.0 app that adds “String.IsNullOrWhitespace”. It performed the worst of all. You can download the VS2010 test solution here:

N.B. Jeremy commented to try:

I did this and it actually ran faster than bool isEmpty =myString.Length == 0;

so you could use this and achieve the need to test for null, and still be the fastest of the three methods shown.


Crunch Time for Visual Studio 2010

Just a note to beta testers, MVPs and others who are “exercising” Visual Studio 2010 RC:

This is the time to get your stuff in to Microsoft Connect (or other appropriate venues) – as quickly as possible. I’ve already submitted several issues (mostly minor ones) and I see that the C# Insiders listserv has been very active with discussions.

The sooner you can identify an issue and give the appropriate dev team a heads –up so they can check it out, the better a product we’ll see at RTM release time.

Visual Studio 2010 is going to be a really great product - and there is still time for us to help make it even better.



SQL Server 2008 64-Bit vs 32-Bit Performance

I’ve got an x64 machine I do most of my “hard core” development work on, that I’m very happy with. I’m running Windows 7 Ultimate x64 and have had few problems. The box only has 4GB RAM, but I almost never hit the ceiling with that, no matter what the heck I do.

But recently, we needed to do some work on a database that has some tables with close to 6 million rows, and I needed to build FullText catalogs for some of them.

That’s where SQL Server 2008 x64 crapped out. I had memory consumption issues that caused me to have to hold the power button down for 4 seconds just to be able to “get out of Dodge” if you will -- several times too. Mouse didn’t work, machine was unresponsive, etc. – just building a FullText catalog on this big table. Now I don’t care about all the KB’s and suggested “Fixes” and all that. I haven’t got the time to futz with this crap.

So I said, OK, let’s get rid of this sucker and see if the x86 version of SQL Server 2008 does better. So I did, and guess what? I still have memory consumption issues, but everything is faster and it never gets to the point where I lose control of the machine. The whole process of switching only took a little over an hour. Incidentally, on an x64 machine SQL Server 2008 “tries” to install the x64 version by default. You need to go into the x86 folder and run the “LandingPage.exe” file and it will happily install the x86 version on your x64 box!

Another issue is that I have never been able to install SP1 on either the x64 or the x86 versions because of a crapped-out installation of SQL Books Online that I cannot find the original installation MSI for. That really sucks bigtime, IMHO. The next step is that I will try to make a slipstream installation to fix this.

UPDATE: I figured out a much easier way to get SP1 installed if you have a failed installation of Books Online that is blocking it:  Search the Registry for instances of the value “SQL_Server_Books_Online_Redist”. You should find three keys with this value. Remove them, and SP1 will be happy!

One other little tidbit I discovered. Don’t just “Create indexes” because you “think” they’ll be important. Instead, develop a series of workload queries in a .SQL file, and use the Database Engine Tuning Advisor to run these and make suggestions. The SQL to create the recommended indexes will be right there at the right hand side of the report and you can copy the SQL to the clipboard.

This is important because index creation should be based on how you query your database, not “what you think”. Extra indexes that don’t necessarily contribute to performance with real life queries only create a drag on the server. Here’s what the experts have to say about indexes:

  • Before you can identify and create optimal indexes for your tables, you must thoroughly understand the kinds of queries that will be run against them.
  • Don't automatically add indexes on a table because it seems like the right thing to do. Only add indexes if you know that they will be used by the queries run against the table.
  • Unused indexes slow data modifications, cause unnecessary I/O reads when reading pages, waste space in your database, and increase the amount of time it takes to backup and restore databases.

You may be surprised what the Tuning Wizard recommends – it could be quite different from “what you thought” should be done! And, even “good” indexes become fragmented over time and need to be rebuilt.

What have your experiences been with SQL Server 2008 64-bit?

Go figure.