That is, how do you decide to specialize in a marketable niche? Sure, if I already knew the marketing business I could probably worm my way into doing marketing contracting. Similarly, if I were an expert in cryptography I could start fielding requests.
What if, however, I'm just a proficient developer qualified in relatively mainstream technologies. By simple analysis of economic principles, I'm not highly valued due to the availability of general talent, so I have to subspecialize in some valuable niche. But how do I choose that specialty ahead of time? I can always choose an arbitrary specialty, but it's possible the demand isn't there.
My specialty, for example, may be in compilers, but I have an inkling feeling that being able to untwist some truly horrific legacy Win32 COM garbage may be the more lucrative endeavor. How do I test these theories without wasting a huge amount of time and money?