I am a lawyer in the LA area, helping local restaurant owners in our little mountain village of Idyllwild, California, deal with ASCAP and BMI.
In 1966, the Justice Department criminally prosecuted BMI and ASCAP for Antitrust violations, and the plea bargain resolving those actions because euphemistically known as the "Consent Decree." In each of those cases, the organization is required to offer less than the "blanket" license to anyone who asks for it, like a restaurant. The goon squads that contact these small businesses defraud them by claiming that they have to pay the same as everyone else, but the Consent Decree says otherwise. If the parties cannot agree on a reasonable price, then the NY Dist. Court will take the case.
The Consent Decrees do not identify what kind of subset a given licensee might request, so I chose selected genres of music played in my clients' restaurants: jazz, folk, soft rock, etc. from given eras. ASCAP and BMI refused to give a license by genre, claiming that they have no way of doing that. Thus, for the past 3 years, my clients have paid nothing, waiting for the price BMI and ASCAP would offer. My clients continue to have music, and will only have to pay the reduced rate retroactively, if and when the issue is ever resolved. Rather than be shut down, we put BMI and ASCAP on the defense.
Defense? Absolutely. The Consent Decree requires them to treat all similarly situated licensees equally. If one of my clients pays only 5% of the blanket license, because they are only licensing that 5% of the entire repertoire, BMI and ASCAP's revenues go from $1000 per year to $50 per year, for example, from every such restaurant. If we get it, everyone else has to.
From another perspective, such a genre-based licensing would upset BMI and ASCAP's entire structure. Right now, since they don't know what songs are played in a restaurant, all of that money [with elevator music, shopping malls, stores, mechanic shops, etc] goes into the radio station pool, to be distributed based upon who is hot this week. We may play James Taylor songs in our restaurant, but Beyonce gets that money because of her air time. If BMI and ASCAP had to assign genres to their songs, the natural result would be mini-pools, where soft rock performers would want to get their share of the soft rock restaurant license money. The radio top 40 artists would be deprived of that income, and it would go to the rightful owners in at least a closer designation than the radio pool. When you consider that live music played in restaurants caters to the older crowd who can afford the entertainment restaurant, and that the catering means oldies, you would have all of the oldies performers suddenly getting royalties again, to their delight. Thus, the consumers win, the restaurant owners win, the artists win, and BMI and ASCAP bite the bullet.
When you consider the impact of millions of businesses demanding genre-based licenses at greatly reduces prices, it is billions of dollars in income shifting, and billions to the truly-entitled oldies artists. If you ask BMI and ASCAP, they flatly say it's impossible, since they have millions of songs in their database. However, if they simply set up a page on their site for the copyright owners to log in with an assigned username and password, they can assign their own genres to their songs, going directly into the database. I told them that they can hire a kid from a closed record store to help them assign genres, sine they feign inability. They also try to confuse the issue by saying that any song can be played in any style [the Triple Nickel case], but this is different: the song itself has an assigned genre, so if it's in the license of the restaurant, they can play it, and if not, not. What's the problem with that? They have no answer. The Department of Justice has not prohibited genre-based licensing, so it's only the BMI and ASCAP reluctance that creates the problem.
As long as they continue to defraud the public, saying that the restaurant MUST buy the blanket license, and that it is in violation of the Consent Decree to offer a lower price, the restaurants and other businesses paying protection money are just being shaken down. One irony is they they use their criminal plea bargain as the basis for their extortion. The other irony is that BMI and ASCAP are supposed to be helping their members, but since most of their repertoire are oldies, now, they're betraying their fiduciary duty to the vast majority of their members, and lining their own pockets with their commission from the overcharging.
Actually, it is now possible to write software that identifies a song being played. So, it would be easy to install a program that automatically analyzes each song played and charge per song. The licensing cartels do not do this, because they maximize their revenue by overcharging for a bulk license. The bulk license favors the songs that already hits, most of which are owned by the large corporations that back the licensing cartels.
Even though copyrights are issued to individuals, you typically have to sign away your copyright in order to get published. So, copyright is theoretically a system that promotes individual rights, but you have to sell those rights to the gatekeepers to get promoted. The Internet changes this somewhat, but the media cartel still has a lot of power.
If you know where to look, you can find royalty-free music. That's music you can legally play without paying any licensing fees. Maybe you should look into this and advise your clients to do this? If you made a collection of royalty-free music, along with a letter saying you legally reviewed it, that could be an interesting product.
The correct answer is "Intellectual property is not a valid form of property." Patents, copyrights, and trademarks all lead to legal extortion, as your clients are facing with music licensing. It was a mistake to allow them to be treated as property, but unfortunately that's the way the system is set up now.
commented on NFL Players Are Underpaid For The Playoffs And Super Bowl.
They can suck it up & play
Most have 1 job..like catch the ball ..they make plenty & beyond
People are starving & they are buying guns girls cars for heck of it.
If you posted the code in all languages, maybe we could crowdsource optimizations?
Also, are you familiar with ASM.js? It could go a long way in FF. http://blog.mozilla.org/mbest/2013/06/25/asm-js-its-really-fast-backwards-compatible-and-now-in-the-release-version-of-firefox/
Are you really interested? If someone's interested in doing that, I'll post it. The code only sort of works. It isn't polished.
Asm.js still isn't as fast as a native binary, but it'd be closer.
I do plan on finishing it, but I'll probably just have the calculation done on the server, with PHP doing a shell_exec to the C program.
It also would be interesting to try other languages, like Java, VB/C#.NET, Ruby, Python, etc. I still say that the C/C++ version would perform best.
OK, I uploaded my code. Here it is.
Just poking around at the C++ I get 250-300ms for each test (depending on targeting x86 v. x64, etc.) or about 8 million calls to evaluate_hand_96 per second (that's getting called about 2.6 million times). Which seems reasonable to me in raw numbers (this is on a 3.6 GHz i7, Win7x64, Visual Studio 2010), coming in at around 450 clock cycles per evaluate_hand_96. I tried running it through VTune Amplifier but I think the profiling doesn't give helpful results because the inner loops are so small that sampling isn't terribly useful. I tried removing the function pointers and converting some logical ops to arithmetic ones (I think I shaved off 50ms, but it could be a result of the optimization settings).
I've read the code enough to understand the structure, but I haven't looked to see why the inner loop is getting so many calls. Assuming that's really how much work needs to get done, I don't see an obvious way to tune it up without multithreading, etc.
I haven't looked at the other code yet (I will over the weekend), but you can contact me at the included email if you like.
1.a. When I want to run it to loop over every hand and make a full strategy table, I can do multiple processes.
2. I think that's one advantage of C++ with full optimization. It inlines the functions.
Also, Visual Studio, when you compile for release, automatically turns on full optimization for you. With gcc, I had to remember to do that myself on the command line.
4. If you optimize the code in one language then, to make it a fair comparison, it has to be optimized in each language. I thought that the exact same algorithm in each language would be the most valid comparison.
The inner loop gets so many calls because, when you draw 5 cards, it needs to evaluate 47*46*45*44*43/5! possibilities for what you could draw. When you draw 4 cards, it needs to evaluate 47*46*45*44/4! possibilities. That's a lot of iterations. Drawing all 5 cards is stupid sometimes, like when you have a pair, but for completeness I always check every possibility.
Also, I put the function pointers in, because I want the same code to work with multiple video poker variants. I'm also doing Double Joker Wild, which means a completely different function to evaluate the hand. Other video poker variants give a bonus for certain 4-of-a-kinds, which also would require a completely different evaluation function.
Yah, I figured that sounded like it was about right for the combinatorics, but doing a quick calculation of 47 choose 5 comes up with 1.5e6 not 2.6e6. I figured multi-threading was out for purposes of comparison, and that any optimization for one language should be for all--I just tackled first what I know best.
47_choose_5 is 1.5E6. 47_choose_4 is 1.7e5, but you draw 4 cards 5 times (5 different possibilities for holding one card).
When I do the double joker wild variant, it'll be a 54 card deck.
Also, I don't want the code to take shortcuts, by making assumptions such as "always hold a pair". In some video poker variants (especially with wild cards), a pair is a bad hand to hold. I could take shortcuts by making the code more intelligent, but that would limit the ease of modifying it for various video poker variants.