Pages
-
Recent Posts
- Entertainment Industry Embraces New Business Model: Suing Google For Third-Party Android Apps That ‘Promote Piracy’
- FTC Reminds EPIC That Suing The FTC To Get It To Investigate Google Might Not Be The Best Idea
- [one-liner]: Using the Linux Command, dirsplit, to Dynamically Backup a Directory Over Multiple DVDs
- European Commission Suggests ACTA’s Opponents Don’t Have ‘Democratic Intentions’
- I can’t design in the browser
Archives
- February 2012
- January 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- July 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- December 2008
- November 2008
- October 2008
Meta
Monthly Archives: July 2010
PHPHOST BLOG
Web Hosting Related Articles You May Need
Calculate the Size of a Folder/Directory using .NET 4.0
.NET 4.0 introduces 7 New methods to Enumerate Directory and Files in .NET 4.0. All these methods return Enumerable Collections (IEnumerable<T>), which perform better than arrays. We will be using the DirectoryInfo.EnumerateDirectories and DirectoryInfo.EnumerateFiles in this sample which returns an enumerable collection of Directory and File information respectively.
Here’s how to calculate the size of a folder or directory using .NET 4.0 and LINQ. The code also calculates the size of all sub-directories.
C#
using System; using System.Linq; using System.IO; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { DirectoryInfo dInfo = new DirectoryInfo(@"C:/Articles"); // set bool parameter to false if you // do not want to include subdirectories. long sizeOfDir = DirectorySize(dInfo, true); Console.WriteLine("Directory size in Bytes : " + "{0:N0} Bytes", sizeOfDir); Console.WriteLine("Directory size in KB : " + "{0:N2} KB", ((double)sizeOfDir) / 1024); Console.WriteLine("Directory size in MB : " + "{0:N2} MB", ((double)sizeOfDir) / (1024 * 1024)); Console.ReadLine(); } static long DirectorySize(DirectoryInfo dInfo, bool includeSubDir) { // Enumerate all the files long totalSize = dInfo.EnumerateFiles() .Sum(file => file.Length); // If Subdirectories are to be included if (includeSubDir) { // Enumerate all sub-directories totalSize += dInfo.EnumerateDirectories() .Sum(dir => DirectorySize(dir, true)); } return totalSize; } } }
VB.NET 10.0 (converted using online tool)
Imports System Imports System.Linq Imports System.IO Module Module1 Sub Main() Dim dInfo As New DirectoryInfo("C:/Articles") ' set bool parameter to false if you ' do not want to include subdirectories. Dim sizeOfDir As Long = DirectorySize(dInfo, True) Console.WriteLine("Directory size in Bytes : " & _ "{0:N0} Bytes", sizeOfDir) Console.WriteLine("Directory size in KB : " & _ "{0:N2} KB", (CDbl(sizeOfDir)) / 1024) Console.WriteLine("Directory size in MB : " & _ "{0:N2} MB", (CDbl(sizeOfDir)) / (1024 * 1024)) Console.ReadLine() End Sub Private Function DirectorySize(ByVal dInfo As DirectoryInfo, _ ByVal includeSubDir As Boolean) As Long ' Enumerate all the files Dim totalSize As Long = dInfo.EnumerateFiles() _ .Sum(Function(file) file.Length) ' If Subdirectories are to be included If includeSubDir Then ' Enumerate all sub-directories totalSize += dInfo.EnumerateDirectories() _ .Sum(Function(dir) DirectorySize(dir, True)) End If Return totalSize End Function End Module
I got the following output after running this code.
To confirm that the code worked as expected, I opened Windows Explorer > C Drive > Right clicked the folder > Properties. Here is the screenshot that matches the output we got from our code
Posted in .NET, LINQ, Syndicated
Leave a comment
Lawyer For Mother Accused Of Killing Baby, Threatens Separate Lawsuit Over People Copying His Facebook Photos
Ah, the perils of lawyers confused about the internet. Reader kb alerts us to the news of lawyer Jose Baez, who apparently has received plenty of attention for defending Casey Anthony, a mother who stands accused of killing her 2-year-old child. Apparently, some of the blogs that are reporting on the case pulled some photos from Baez’s Facebook profile and Photoshopped them to include in blog posts. Baez’s response is to threaten a lawsuit against those bloggers saying it’s copyright infringement, while pulling down all of his photos. As kb notes, it appears that this lawyer doesn’t seem to understand copyright law, fair use, Facebook’s privacy settings or the Streisand Effect in that this effort is only drawing that much more attention to the blog posts he’s upset about. Nice work.
Posted in Syndicated
Leave a comment
Barney Frank’s Attempt To Allow & Tax Online Gambling Moves Forward (Again)
Back in 2006, some politicians included a bill that effectively banned online gambling as a part of a law designed to protect our ports (don’t ask what one has to do with the other). Pretty much since then, Rep. Barney Frank has been seeking to legalize online gambling (in order to tax it), and he just got a step closer to that as the House Finance Committee has passed a version of his bill. There were, not surprisingly, complaints against how this bill would “bring gambling into everyone’s homes,” but that ignores (of course) that it’s already available in homes, and the feds have long admitted that they have no idea how to enforce the original law.
Of course, this is not the first time that the House Finance Committee has approved such a bill, and in the past it went nowhere. So, there’s still a half decent chance that this really means nothing much.
Still, there are some interesting provisions in the bill, as a few amendments were added, including banning the companies who have currently been letting Americans play poker online from getting approved for a license. Yes, all of those online gambling sites who are still offering services and hoping this bill passes… may get shut out by it. Of course, they might have a pretty strong legal case that this is not legal, seeing as some courts have suggested that poker is not technically gambling. Another amendment would bar those who are behind in child support payments from visiting online gambling sites, though I don’t see how they enforce that one.
Posted in Syndicated
Leave a comment
Colbert Helps Save World From Polka Pirates
A few of you have sent in the fact that the Colbert Report recently did a fun segment about a guy arrested for selling polka DVDs:
| The Colbert Report | Mon – Thurs 11:30pm / 10:30c | |||
| Nailed ‘Em – Polka Piracy | ||||
|
||||
For all the talk we hear about how DVD counterfeiters are connected to “organized crime” and “terrorists,” a lot of the times it’s really situations like this one, involving a guy who did a public access TV show about polka. Someone called him to see if they could buy some DVDs of the show, so he made a few DVDs and sold them. But the whole thing was a setup, and the next morning he was arrested. The whole thing shows what a joke some of these claims really are.
Separately, I do find it amusing to see folks like Colbert mock the overreaction to things like copyright infringement — considering that his employer, Viacom, is so aggressive on spreading the myth that DVD counterfeiting is really about supporting terrorism and organized crime.
Update: Good discussion in the comments about what the specific charges were in this case. Apparently, the guy used government equipment to make the recording and DVDs, so the local government felt it was theirs — and they sold their own DVDs, which this guy’s DVDs undercut. He was charged with using city property for “personal gain.” Oddly, there’s an “embezzlement” charge as a part of this… More details here.
Posted in Syndicated
Leave a comment
Yes, People Can Comment On Content Business Models Without Having Produced Hit Content
We’ve seen it over and over again in the comments on Techdirt. We’ll talk about the impact of copyright or patents, and a lawyer will claim that unless we’re an IP lawyer, we should not comment. Or we’ll talk about content business models for the music or movie industry, and someone will claim that until we’ve had a hit song or movie, we should not comment. The argument always struck me as a curious one. After all, just because you don’t have a law degree, doesn’t mean you can’t understand copyright law. In fact, since we’re usually talking about the economic impact of copyright law, it seemed like the easy retort is that if those lawyers didn’t have an economics degree, perhaps they shouldn’t be talking about the impact of copyright law either. Of course, that’s silly. The fact is, anyone who understands the basic issues has a right to give their opinion, and back it up with facts and discuss their positions. But saying that someone who doesn’t have “x degree” or “y experience” is usually a response from someone who doesn’t want to argue the actual details.
Filmmaker Ross Pruden just wrote a blog post discussing this, where he pointed out that you don’t need first-hand experience to understand details and make a proper judgment call about how to run a business. When we talk about music or movie business models, I’m not suggesting I know how to make a hit song or movie. But I can look at the economics and suggest what makes sense from a business perspective given the market today. Just as Ross can look at the market and realize that how things are done today don’t make as much sense, even if he hasn’t (yet) made a “commercially successful film.”
This whole appeal to a false authority is a bit annoying, because it’s an easy way to dismiss the messenger without addressing the message. I doubt it will change, but it was nice of Ross to call out this point. Having created a hit song doesn’t mean you know how to navigate a changing market. Knowing how to produce a blockbuster movie doesn’t mean you know how to use the internet to your advantage. Knowing how to get a patent doesn’t mean you know how patents impact innovation. Unfortunately, some people think that if they know one aspect of these things, only they are allowed to comment on the business models or economic implications. That’s simply not true — and those who go there tend to be in denial about the market challenges they face.
Posted in Syndicated
Leave a comment
Wikileaks Afghan War Document Leak Again Raises Questions: Treason Or Whistleblowing?
A few weeks back, as part of our discussion on the arrest of Bradley Manning for handing over classified documents to Wikileaks, we questioned where to draw the line between “whistleblowing” and “criminal” leaking of military secrets. At the time, we compared the situation to Daniel Ellsberg and the Pentagon Papers. With the the new leak of nearly 100,000 documents about the war in Afghanistan, that same question is getting a lot more attention.
Ellsberg says that the leak is no different than the Pentagon Papers. Both involved massive leaks that showed a government was not being entirely forthright with the public about the status of a war. Others in that article suggest there are some key differences, in the lack of any smoking gun of direct lying by the government (in the latest case, it was more about just not telling the full truth), as well as the scattershot nature of the content. But that’s no matter to some grandstanding politicians, like Rep. Pete King who were quick to call the leak treasonous and demand prosecution of those involved (he seems to imply that he believes Manning leaked these documents, though no one has said that conclusively yet).
Of course, that was the strategy taken by the Nixon White House in response to the Pentagon Papers — to attack the messenger. It looks like the Obama White House is taking a rather different response. While worrying about how the leaks could “jeopardize” people or operations on the ground, the White House is actually trying to turn the few revelations into an advantage, by claiming that the information revealed support the strategy the military has taken under his watch. Whether that’s true or not, this actually does seem like the type of response that could diffuse the criticism much faster than simply screaming “traitor!”
Of course, some of the revelations, such as the news that the US was paying Afghani press people to run positive stories about the US don’t look good at all, no matter how you spin them.
On the whole, it seems like the debate about whether this is “whistleblowing” or “traitorous” behavior misses the point. The fact is, information like this is going to get out — probably at an increasing rate. The real question is how does the government and the military learn to function in a society where information is a lot more open and free.
Posted in Syndicated
Leave a comment
Can Man Who Found Long Lost Ansel Adams Glass Negatives Sell Prints?
Reader Ken points us to a “feel good” story of a guy, Rick Norsigian, who found a box of old glass negatives at a garage sale in 2000, which he bought for $45 (bargained down from the $70 the other guy wanted). It turns out that a bunch of experts have now agreed that the negatives are actually previously unpublished works by Ansel Adams. Most of the article focuses on how Norsigian got the negatives, why the experts seem pretty convinced the negatives are from Adams and even how the negatives might have ended up in Southern California. However, right at the beginning, the article says the negatives “may be worth $200 million.” Oddly, this isn’t elaborated on until the end, when they claim that sales of prints from those negatives could net Norsigian $200 million:
It could be a while before he sees the profits from the sale of prints from the negatives, but Streets estimates over the next 25 years it could mean over $200 million for Norsigian.
Ken wondered about that statement, since there may be some copyright issues here, and as far as I can tell, he’s right. I can’t see how Norsigian has any legal right to sell the prints at all — though, perhaps some copyright scholars could chime in. The works are estimated to have been made in the 1920s, which could actually complicate things. However, from all of the indications, none of these works were “published,” and as the handy dandy public domain tracker notifies us, unpublished works are given a copyright of “life of the author +70 years.” Ansel Adams died in 1984, so it would appear that the copyright on the images would likely belong to his heirs, and will last until 2054.
Now, if the works were published (which seems unlikely) then it gets a bit complicated. If they were done before 1923 (and no one’s exactly sure of the date on most of these negatives), then they’re in the public domain. If they were done after 1923 and weren’t registered at the Copyright Office then, again, they’re in the public domain. If that’s the case, then Norsigian actually could make prints, but once those prints were out there, others could most likely copy the prints and sell competing prints themselves legally, which could put a damper on the $200 million. Of course, there then could be things Norsigian could do, such as specially “branding” his prints in some manner, but it’s a bit trickier.
If the works were published after 1923, registered at the Copyright Office and had that registration renewed, then they should retain the initial copyright until 95 years after publication, meaning, until at least 2018 (and, again, most likely remaining with Adams’ heirs). But, if that were the case, it seems unlikely that these negatives would have been considered “lost,” though it is possible.
And, for those of you wondering, no, owning the negatives does not give you the copyright on the images, even if that creates a weird situation where someone who owns a bunch of negatives might not legally be able to use those negatives (yay, copyright law!).
The most likely scenario remains the first one, which would suggest Norsigian might actually get into legal trouble for making prints. And, in fact, the managing director of the Ansel Adams Publishing Rights Trust, Bill Turnage, first says that Norsigian’s claims are a “fraud” and he’s actually considering suing over Norsigian’s use of Ansel Adams’ name for commercial purposes (the article claims “copyrighted name,” but I believe the AP reporter gets that wrong — at best there may be a publicity rights claim under California state law). Of course, that puts another twist on the situation as well. If the Adams’ heirs deny the prints are Adams, but they’ve been authenticated as Adams’, then could the Adams’ heirs still then make a copyright claim on any prints? That could be fun.
Of course, Adams himself, were he alive, might find the whole debate amusing. As the article notes (and which is well known among followers of Adams):
“Ansel interpreted the negative very heavily. He believed the negative was like a musical score. No two composers will interpret it the same way,” he said. “Each print is a work of art.”
In other words, if Norsigian does make prints, they wouldn’t be considered the same thing as a true Ansel Adams print. It might be more like a high school orchestra performing Beethoven.
Still, from a copyright perspective, there may be a very interesting legal battle brewing…
Posted in Syndicated
Leave a comment
Microsoft’s ‘Street Slide’ takes aim at StreetView
A new mapping technology from Microsoft’s Research team takes the idea of a panoramic street view and stitches it together into one long stream of map tiles.
Originally posted at Web Crawler
Posted in Syndicated
Leave a comment
Dear Warner Bros., It’s Not ‘Word Of Mouth’ If You Have To Pay People To Promote Your Movies
There was an amusing post this week at TheWrap.com discussing how the various Hollywood movie studios are confused about the basics of social media and Twitter. You may remember (or, maybe not), back in 2003, when Hollywood suddenly started blaming text messaging for certain movies failing, because some kids would go to a movie, realize it sucks, and quickly warn their friends to stay away. Of course, Hollywood blamed text messaging, instead of the fact that they made a crappy movie, and couldn’t rely on their old methods of squeezing a ton of money out of people before word got around. In the age of Twitter, of course, this has only increased, so the studios started blaming Twitter, calling it “the Twitter Effect” and proceeding to freak out about it.
This new article points out that “The Twitter Effect” doesn’t really appear to have any impact at all, but does mention that studios are trying to jump on this “Twitter” bandwagon by “buying trending terms” on the site. But watching the movie studios try to figure out this whole social media landscape can be pretty funny. Adam Singer sent over an email he just received from Warner Bros. asking him to join its “word of mouth marketing team” in which the studio would pay him to say nice things about Warner Bros. films:
Hello,I am a part of the Warner Brothers word of mouth marketing team and recently came across your blog! Your blog uniquely stood out as dynamic, informative and highly creative. We are seeking bloggers that are passionate about entertainment to help us engage your readers with content that would be interesting to them.
We would like to have you join our WB Word marketing team to let fans know about our latest releases and relevant content/products. As a member of the team, you will be asked to display photos, clips, and stories on your Blog, Facebook and Twitter accounts. The best part is you will get paid! Additionally, we may even debut event previews and new content so that fans like you get to enjoy it first.
Here’s a tip for Warner Bros.’ “word of mouth marketing team.” If it’s really “word of mouth marketing,” it probably doesn’t require you to pay people to talk about your bad movies. And, of course, depending on how the various bloggers on the “team” indicate their relationship with WB, the studio may be opening itself up to FTC problems.
Posted in Syndicated
Leave a comment
Paramount Sends More Bogus DMCA Takedowns On Fans Filming Transformers 3 Shoot
Earlier this year, there was a reasonable bit of fuss over Paramount issuing a bogus DMCA takedown on someone who had videotaped a brief snippet of the filming of the next Transformers movie, which was going on in an alleyway right outside the guy’s office. It was difficult to see what sort of “copyright” violation there was here. The guy, Ben Brown, had filmed it himself, and it wasn’t like it was a private set or anything. Paramount never made any sort of statement, but the video did go back up a few days later. Apparently, the over aggressive lawyers at Paramount didn’t learn their lesson. Apparently, a bunch of videos that people shot themselves of filming of the movie going on in Chicago were all taken down from YouTube under DMCA claims. Again, it’s difficult to see how these claims are legit — and this is especially troubling, seeing as it comes from Paramount, which is owned by Viacom. Viacom, of course is involved in a bit of a legal battle with YouTube — but, more importantly, in a previous legal battle over bogus Viacom DMCA takedowns, Viacom had agreed to manually review all takedown notices to avoid bogus takedowns like this one.
Posted in Syndicated
Leave a comment
LATEST NEWS
