Again, this can be useful for parsing HTML bound for rich text email, where you need to use inline styles -- for example when sending to a gmail account. this will scoop out the styles and plop them into the tag itself, it also will replace double quotes with single quotes for those pesky font familes that include spaces in the name
// PHP 4
// attempt to replace tag based class definitions with inline styles
// add tags to the array to expand the scope
$sar = array('h1','h2','h3','h4','p','ul','li');
$i = 0;
$sarsize = sizeof($sar);
while($i<$sarsize){
$tag = $sar[$i];
$pattern = '/(?<='.$tag.'.\{)[^}]*/i';
$style = preg_match ($pattern, $file, $smem);
$attributes = str_replace("\r\n"," ",$smem[0]);
$attributes = str_replace('"',"'",$attributes);
$attributes = str_replace("\t"," ",$attributes);
$file = str_replace('<'.$tag,'<'.$tag.' style="'.$attributes.'"',$file);
$i++;
}
$i = 0;
Tuesday, November 10, 2009
Monday, August 17, 2009
The 99¢ economy
The Apple store demonstrates how infinite resources drive price down to a convenience fee
The apple app store is a great tool to study pricing effects. Game developers are learning that $9.99 might seem like a fair price, yet by reducing the price by 90%, the net dollar amount of sales skyrocket. When the price is reduced to a sub dollar amount, the potential marketplace expands exponentially. If something is infinitely reproducible for zero cost, the economics get a little nutty, and that's what software developers are beginning to figure out. If you have a popular consumer digital product, It's actually in your best interest to charge as little as possible in order to maximize your sales. The issue many marketing types don't yet get is that in a digital marketplace, the more valuable your product is, the lower it's price — and as the price drops your profits go up, not down.
In a perfect supply and demand economy all digital prices will fall to that of a convenience fee, lets say for example, 99¢. It won't matter what you are selling, whether it's an app that makes your telephone play back fart sounds, or a word processor, or a 3 hour long science fiction movie, a hit record, or even software that allows you to do 3D design and drafting for heavy industry. If it's a popular app or genre, someone is going to undercut you with a better product for a lower price until the price reaches that of a convenience fee. Think Redbox.
The profitability comes from keeping the price intentionally low, yet steadily adding value to the product in order to increase popularity. Would Adobe earn more money by reducing the price of Photoshop from $861.00 to 99¢? — 6 billion humans on the planet? — I bet they would, but until they figure out that in a digital economy price and value have a inverse relationship, I would not bet on it.
The apple app store is a great tool to study pricing effects. Game developers are learning that $9.99 might seem like a fair price, yet by reducing the price by 90%, the net dollar amount of sales skyrocket. When the price is reduced to a sub dollar amount, the potential marketplace expands exponentially. If something is infinitely reproducible for zero cost, the economics get a little nutty, and that's what software developers are beginning to figure out. If you have a popular consumer digital product, It's actually in your best interest to charge as little as possible in order to maximize your sales. The issue many marketing types don't yet get is that in a digital marketplace, the more valuable your product is, the lower it's price — and as the price drops your profits go up, not down.
In a perfect supply and demand economy all digital prices will fall to that of a convenience fee, lets say for example, 99¢. It won't matter what you are selling, whether it's an app that makes your telephone play back fart sounds, or a word processor, or a 3 hour long science fiction movie, a hit record, or even software that allows you to do 3D design and drafting for heavy industry. If it's a popular app or genre, someone is going to undercut you with a better product for a lower price until the price reaches that of a convenience fee. Think Redbox.
The profitability comes from keeping the price intentionally low, yet steadily adding value to the product in order to increase popularity. Would Adobe earn more money by reducing the price of Photoshop from $861.00 to 99¢? — 6 billion humans on the planet? — I bet they would, but until they figure out that in a digital economy price and value have a inverse relationship, I would not bet on it.
Tuesday, April 7, 2009
Replacing CSS styles with inline style for rich email
Ever get frustrated when you use a "dreamweaver" style markup system, just to find that class definitions don't show up in certain email rendering environments?
The trick is to swap the declared classes for inline styles. I found another solution on the web that was way more complex than it needed to be, so here is a simpler way to do it:
note: in PHP and where $file is your HTML code:
// replace dreamweaver CSS class definitions with inline styles
if (preg_match("/class=/i", $file) ){
$wer = preg_match_all("/\.style[^\}]*\{*\}/i", $file, $hello);
foreach(array_unique($hello[0]) as $rest) {// rest is now the whole style class declaration
$rest=trim($rest);
$rest = str_replace("\n"," ",$rest);
preg_match_all("/\.style\S*.(?=\s+\{?)/i", $rest, $h2); // $h200 should now be just the .style45654 part
preg_match_all("/(?<=\{)[^}]*/i", $rest, $h3); // $h300 should now be just the definitions within the style
$styledef = trim ($h3[0][0]);
$simplestylename = trim ($h2[0][0]);
$simplestylename = str_replace('.','',$simplestylename);
$clssub = 'class="'.$simplestylename.'"';
$clsrp = 'style="'.$styledef .'"';
$file = str_replace($clssub,$clsrp,$file);
}
}
The trick is to swap the declared classes for inline styles. I found another solution on the web that was way more complex than it needed to be, so here is a simpler way to do it:
note: in PHP and where $file is your HTML code:
// replace dreamweaver CSS class definitions with inline styles
if (preg_match("/class=/i", $file) ){
$wer = preg_match_all("/\.style[^\}]*\{*\}/i", $file, $hello);
foreach(array_unique($hello[0]) as $rest) {// rest is now the whole style class declaration
$rest=trim($rest);
$rest = str_replace("\n"," ",$rest);
preg_match_all("/\.style\S*.(?=\s+\{?)/i", $rest, $h2); // $h200 should now be just the .style45654 part
preg_match_all("/(?<=\{)[^}]*/i", $rest, $h3); // $h300 should now be just the definitions within the style
$styledef = trim ($h3[0][0]);
$simplestylename = trim ($h2[0][0]);
$simplestylename = str_replace('.','',$simplestylename);
$clssub = 'class="'.$simplestylename.'"';
$clsrp = 'style="'.$styledef .'"';
$file = str_replace($clssub,$clsrp,$file);
}
}
Monday, March 24, 2008
BLOCKBUSTED: How a 30 year old assumption created the Blockbuster behemoth by picking Hollywood's pockets.
The year was 1980 and first video players were gaining popularity. A new form of home entertainment had been created. Suddenly the average family could watch Hollywood hits in the comfort of their own homes, anytime they wanted, as many times as they wanted. It was indeed a revolutionary change for the film industry and consumers.
Early adopters paid a stiff price with machines north of $1,000 and individual movies priced at $100-$200 to purchase. For those who were in love with the technology it was an easy decision. The price was high, but it was worth it for a sexy new technology. Everyone assumed owning a Hollywood hit would be a privilege with a high price tag. Superman and Tootsie were multi-hour well-acted epic sagas, not just some BEE GEEs record or a paperback novel. The price was fair and the value was there.
I had a taste of just how cool these machines were; my fifth grade friend's family bought a Betamax machine and the movie Superman. The movie was $189 (in 1981 dollars). That was the only movie the family ever bought.
By 1986 a third of US households had a VCR or Beta machine. By 1988 Sony gave up on Betamax as a viable option to VHS. As late as the mid 1990's VHS tapes directly from distributors were still listed around $90—excluding special promotions for hit movies where direct sales seemed a viable market as long as the price was in the $30-$40 range.
This caused a massive video rental industry to be created. In every town across the country mom and pop stores were charging $2 a night for videotape rentals. Even the local Rite-Aid pharmacy had video rentals.
On almost every street that had small businesses on it, you could find a video rental store. Convenience stores, record stores, supermarkets—they all got in on the action. It's not hard to see why, once the movie was rented enough times, any future rentals were almost pure profit. The math was simple, starting a business was cheap, and no skilled labor or value added services were necessary to be competitive.
US copyright law provides the right of first sale—this allows purchased lawful copies of a work of art to be re-sold, loaned, rented or destroyed, but not mass duplicated for resale. The content creator receives no cut when a video is rented. Effectively, what was happening was that the rental stores were charging a licensing fee for content they did not own—and the two dollars were going to the store owner's pocketbook. No one thought of it this way because consumers were paying two dollars to rent a reel of magnetic tape in a plastic box for one evening.
Why was it so easy to do? Wouldn't it seem that Hollywood would notice this new emerging industry built around its number one product and the amount of cash that was flying around? Hollywood seemed content to be selling a few copies of expensive tapes to the rental businesses and keep their product purposefully scarce. Perhaps they liked the tactics of the Ferrari car company—only sell 1000 cars in North America each year to create exclusivity, and then make the real money on the product licensing deals for the brand. Building Ferrari cars is one thing, but this strategy can not work for a product that can be cheaply duplicated once completed.
By 1989 video rental was clearly a legitimate industry, and like anything else the big profits were attracting corporate investment. Eventually a couple of big public companies began to dominate the video rental business. It was such a profit producing industry that Blockbuster stores were opening faster than chain coffee retailers are today. Blockbuster, with their then-radical "two night rental" policy was amassing a fortune $3 at a time because they understood the value proposition to the consumer—and the movie producers did not.
Eventually movie prices fell to the point where consumers could make the decision to purchase the movie for their collection, or rent the movie for 1/3 the price. Luckily for Blockbuster, the value to the consumer remained in the rental arrangement. It was an entire industry built around a simple mistake: Hollywood's inability to recognize the simple economics of value. The reason that the video rental industry still exists today is that there is no value to the average consumer if he has to pay $20 for the movie. The rental industry essentially corrects this mistake and makes a huge profit that should be enjoyed by the producers themselves.
Hollywood didn't get the formula right.
Blockbuster rents the movie 5 times for $5, and then sells it for $10. What if those same 6 people bought the movie at a supermarket for $3.99 instead of fooling with renting it? If most consumers purchase 2 or 3 new releases on disk, yet rent 40-70 disks in a year, where's most of the consumer cash going? To Blockbuster or Hollywood?
What if Hollywood decided to eliminate rentals altogether and sell to the consumers for the same price? If most disk sales are wholesale to Blockbuster who can extract $35 cash from each disk, why does Hollywood let Blockbuster get fat on its lunch? Perhaps it's because they are holding out to sell $38 Blu-Ray disks? $38 disks are going to be a hard sell when the cost of infinitely reproducible digital goods always drops to near zero on a long enough time line.
Here is the thing that Hollywood has trouble admitting: Unlike audio disks most people will not watch a movie more than twice, so by purchasing the movie they are overpaying for the experience of viewing it. Because the product is only valuable on the first or second uses, it can be thought of as a toy that becomes unwanted in 2 to 4 hours. Feature film disks are actually less valuable than audio disks to the average consumer.
Even though it costs $250 million to produce a movie, it's only worth $4 to the average consumer. Hollywood tries to market their disks as collectible, durable goods because of the prestige—but a modern economist analyzing the situation recognizes that disks are actually in fact disposable commodity items not too dissimilar to plastic razors. Audio disks on the other hand are worth much more because they are much more durable.
Consider the new world of digital movie downloads. Consumers pay $3-$6 to download a digital file to a computer or computer-like device and then have a given amount of time before the movie expires. Some think that the expiration mechanism is there to spur hard copy sales, or to deter file trading, but the real reason it's there is to prop up the artificial value of the movie. If the movie does not expire from the hard disk, consumers have effectively paid $3.99 to "own" the movie. If it remains on the hard disk the line between owning and renting would blur. Would consumers watch The Fast and the Furious 75 times on their computer if it did not eventually erase itself? Would Hollywood somehow be losing money if that happened? The answer is probably not, but the expiration mechanism remains as an un-natural way to add value to physical disc ownership by limiting the electronic product.
Movie producers need to embrace the fact that their products are disposable. Casual movie fans don't buy every movie they want to see, they rent. They line up every Friday night to cram Blockbuster's cash registers full $4.50 at a time.
Hollywood is choosing the $50 bill instead of the 5,000 nickels. Imagine going from 15,000 paying customers to 300,000,000 paying customers? That's exactly what the $3.99 new release would do. The profit-grabbing physical video rental business would be eliminated overnight.
Bye-Bye Netflix and Blockbuster, thanks for pointing out Hollywood's mistake.
Early adopters paid a stiff price with machines north of $1,000 and individual movies priced at $100-$200 to purchase. For those who were in love with the technology it was an easy decision. The price was high, but it was worth it for a sexy new technology. Everyone assumed owning a Hollywood hit would be a privilege with a high price tag. Superman and Tootsie were multi-hour well-acted epic sagas, not just some BEE GEEs record or a paperback novel. The price was fair and the value was there.
I had a taste of just how cool these machines were; my fifth grade friend's family bought a Betamax machine and the movie Superman. The movie was $189 (in 1981 dollars). That was the only movie the family ever bought.
By 1986 a third of US households had a VCR or Beta machine. By 1988 Sony gave up on Betamax as a viable option to VHS. As late as the mid 1990's VHS tapes directly from distributors were still listed around $90—excluding special promotions for hit movies where direct sales seemed a viable market as long as the price was in the $30-$40 range.
This caused a massive video rental industry to be created. In every town across the country mom and pop stores were charging $2 a night for videotape rentals. Even the local Rite-Aid pharmacy had video rentals.
On almost every street that had small businesses on it, you could find a video rental store. Convenience stores, record stores, supermarkets—they all got in on the action. It's not hard to see why, once the movie was rented enough times, any future rentals were almost pure profit. The math was simple, starting a business was cheap, and no skilled labor or value added services were necessary to be competitive.
US copyright law provides the right of first sale—this allows purchased lawful copies of a work of art to be re-sold, loaned, rented or destroyed, but not mass duplicated for resale. The content creator receives no cut when a video is rented. Effectively, what was happening was that the rental stores were charging a licensing fee for content they did not own—and the two dollars were going to the store owner's pocketbook. No one thought of it this way because consumers were paying two dollars to rent a reel of magnetic tape in a plastic box for one evening.
Why was it so easy to do? Wouldn't it seem that Hollywood would notice this new emerging industry built around its number one product and the amount of cash that was flying around? Hollywood seemed content to be selling a few copies of expensive tapes to the rental businesses and keep their product purposefully scarce. Perhaps they liked the tactics of the Ferrari car company—only sell 1000 cars in North America each year to create exclusivity, and then make the real money on the product licensing deals for the brand. Building Ferrari cars is one thing, but this strategy can not work for a product that can be cheaply duplicated once completed.
By 1989 video rental was clearly a legitimate industry, and like anything else the big profits were attracting corporate investment. Eventually a couple of big public companies began to dominate the video rental business. It was such a profit producing industry that Blockbuster stores were opening faster than chain coffee retailers are today. Blockbuster, with their then-radical "two night rental" policy was amassing a fortune $3 at a time because they understood the value proposition to the consumer—and the movie producers did not.
Eventually movie prices fell to the point where consumers could make the decision to purchase the movie for their collection, or rent the movie for 1/3 the price. Luckily for Blockbuster, the value to the consumer remained in the rental arrangement. It was an entire industry built around a simple mistake: Hollywood's inability to recognize the simple economics of value. The reason that the video rental industry still exists today is that there is no value to the average consumer if he has to pay $20 for the movie. The rental industry essentially corrects this mistake and makes a huge profit that should be enjoyed by the producers themselves.
Hollywood didn't get the formula right.
Blockbuster rents the movie 5 times for $5, and then sells it for $10. What if those same 6 people bought the movie at a supermarket for $3.99 instead of fooling with renting it? If most consumers purchase 2 or 3 new releases on disk, yet rent 40-70 disks in a year, where's most of the consumer cash going? To Blockbuster or Hollywood?
What if Hollywood decided to eliminate rentals altogether and sell to the consumers for the same price? If most disk sales are wholesale to Blockbuster who can extract $35 cash from each disk, why does Hollywood let Blockbuster get fat on its lunch? Perhaps it's because they are holding out to sell $38 Blu-Ray disks? $38 disks are going to be a hard sell when the cost of infinitely reproducible digital goods always drops to near zero on a long enough time line.
Here is the thing that Hollywood has trouble admitting: Unlike audio disks most people will not watch a movie more than twice, so by purchasing the movie they are overpaying for the experience of viewing it. Because the product is only valuable on the first or second uses, it can be thought of as a toy that becomes unwanted in 2 to 4 hours. Feature film disks are actually less valuable than audio disks to the average consumer.
Even though it costs $250 million to produce a movie, it's only worth $4 to the average consumer. Hollywood tries to market their disks as collectible, durable goods because of the prestige—but a modern economist analyzing the situation recognizes that disks are actually in fact disposable commodity items not too dissimilar to plastic razors. Audio disks on the other hand are worth much more because they are much more durable.
Consider the new world of digital movie downloads. Consumers pay $3-$6 to download a digital file to a computer or computer-like device and then have a given amount of time before the movie expires. Some think that the expiration mechanism is there to spur hard copy sales, or to deter file trading, but the real reason it's there is to prop up the artificial value of the movie. If the movie does not expire from the hard disk, consumers have effectively paid $3.99 to "own" the movie. If it remains on the hard disk the line between owning and renting would blur. Would consumers watch The Fast and the Furious 75 times on their computer if it did not eventually erase itself? Would Hollywood somehow be losing money if that happened? The answer is probably not, but the expiration mechanism remains as an un-natural way to add value to physical disc ownership by limiting the electronic product.
Movie producers need to embrace the fact that their products are disposable. Casual movie fans don't buy every movie they want to see, they rent. They line up every Friday night to cram Blockbuster's cash registers full $4.50 at a time.
Hollywood is choosing the $50 bill instead of the 5,000 nickels. Imagine going from 15,000 paying customers to 300,000,000 paying customers? That's exactly what the $3.99 new release would do. The profit-grabbing physical video rental business would be eliminated overnight.
Bye-Bye Netflix and Blockbuster, thanks for pointing out Hollywood's mistake.
Wednesday, March 19, 2008
The truth about the RIAA supporting higher licensing fees
Recordings were first invented to simulate live performances and the first record companies (Edison) were the phonograph manufacturers. It was a way to make sales after the sale of the machinery. Soon, independent record companies began manufacturing these "phonograph disks of recorded music" as well, thus providing a "record" of some musical performance that has occurred in the past, be it in a studio or a "live" performance. If you think about it, it is much like today, a bunch of engineers and scientists are dictating musical taste, applying their skills not to provide the best music or even the best recordings, but to engineer product lines that return the best investment performance for their shareholders.
Bands on the radio probably would not get national exposure without the aid of the record companies. There are hundreds of other acts that sound just like the them, but without company support, they will never get out of the garage. Many would even argue that many do not deserve to get out of the garage.
Since the sixties record companies have learned to manufacture pop superstars made up of amateur models playing simple tunes.
In this current model, the overall quality of music that is consumed by the public is generally low and formulaic. The radio stations engineer their play lists in the same manner, ensuring that they are pleasing the majority of their listeners and their advertisers.
This limits the overall choices to the publics ear, ensuring that only the most profitable music has the best chance of exposure to the general population. This very market force artificially lowers the publics taste for more complex and creative musical styles.
This is also why the RIAA wants the government to impose unmanageable fees on podcasts and internet radio. Since they and the record companies do not have much influence on these play lists, there is the risk of dilution away from the most profitable songs. On the surface the strategy is to raise more licensing revenue from internet broadcasts, but the real strategy is to keep music off the internet where musical taste is harder to dictate, and instead use FM radio to direct record sales to profitable categories.
Let's assume a world where free internet radio becomes the standard for exposure to new music -- Selling copyrighted recordings will eventually become a somewhat silly business to try to get into. It won't be cost effective to support bands and spend $400,000 on recording studio fees If radio is free and recordings are free, this leaves live performance as the main revenue model. So after a brief stint with the obsession of pre-recorded music, the music business returns to its more natural, market-driven business model, and almost everyone wins.
The only artists that will be able to survive in the new music business will be the ones that can perform live *better* than on a recording. This will force the musicianship and quality of popular music to a higher level. Artists that rely on electronics and studio gimmicks will fall out of favor because their live performance will be almost non-existent. And without support from record companies, manufactured music will be difficult to promote and distribute on a national level. This will have the effect of returning the music business back to the musicians (to a certain extent). After a while, the public tastes will change as they are exposed to better music and experience more live performances.
-hank
Bands on the radio probably would not get national exposure without the aid of the record companies. There are hundreds of other acts that sound just like the them, but without company support, they will never get out of the garage. Many would even argue that many do not deserve to get out of the garage.
Since the sixties record companies have learned to manufacture pop superstars made up of amateur models playing simple tunes.
In this current model, the overall quality of music that is consumed by the public is generally low and formulaic. The radio stations engineer their play lists in the same manner, ensuring that they are pleasing the majority of their listeners and their advertisers.
This limits the overall choices to the publics ear, ensuring that only the most profitable music has the best chance of exposure to the general population. This very market force artificially lowers the publics taste for more complex and creative musical styles.
This is also why the RIAA wants the government to impose unmanageable fees on podcasts and internet radio. Since they and the record companies do not have much influence on these play lists, there is the risk of dilution away from the most profitable songs. On the surface the strategy is to raise more licensing revenue from internet broadcasts, but the real strategy is to keep music off the internet where musical taste is harder to dictate, and instead use FM radio to direct record sales to profitable categories.
Let's assume a world where free internet radio becomes the standard for exposure to new music -- Selling copyrighted recordings will eventually become a somewhat silly business to try to get into. It won't be cost effective to support bands and spend $400,000 on recording studio fees If radio is free and recordings are free, this leaves live performance as the main revenue model. So after a brief stint with the obsession of pre-recorded music, the music business returns to its more natural, market-driven business model, and almost everyone wins.
The only artists that will be able to survive in the new music business will be the ones that can perform live *better* than on a recording. This will force the musicianship and quality of popular music to a higher level. Artists that rely on electronics and studio gimmicks will fall out of favor because their live performance will be almost non-existent. And without support from record companies, manufactured music will be difficult to promote and distribute on a national level. This will have the effect of returning the music business back to the musicians (to a certain extent). After a while, the public tastes will change as they are exposed to better music and experience more live performances.
-hank
Subscribe to:
Posts (Atom)
