Tuesday, June 29, 2010

SCOTUS Nominee Kagan On Free Speech Issues

http://yro.slashdot.org/story/10/06/28/1248253/SCOTUS-Nominee-Kagan-On-Free-Speech-Issues
DesScorp submitted one of a few stories I've seen about Supreme Court nominee Elena Kagan, whose confirmation hearings are supposed to start today (despite being a formality, given that she has the votes pretty much locked up). "SCOTUS nominee Elena Kagan hasn't left much of a paper trail during her legal career, which may make gauging her ideas and opinions somewhat difficult. But there are some positions she has made clear statements on, among them, pornography and 'hate speech.' In a 1993 University of Chicago seminar on the subject, Kagan argued that the government wasn't doing enough about the spread of porn or hate speech. She argued that new approaches were needed to fight their spread, as well as taking a fresh look at old approaches, such as obscenity laws. Kagan included herself among 'those of us who favor some form of pornography and hate speech regulation,' and told participants that 'a great deal can be done very usefully' to crack down on such evils."

Saturday, June 26, 2010

SCOTUS Rules Petiton Signatures Are Public Record

http://yro.slashdot.org/story/10/06/25/1421202/SCOTUS-Rules-Petiton-Signatures-Are-Public-Record?art_pos=28

Reader SheeEttin reminds us that back in October, the Supreme Court accepted a case testing whether or not petition signers' names could be kept anonymous. (The premise was that the act of signing a petition is covered by free speech, and thus signers are entitled to anonymity, especially to protect them from harassment.) Now the Court has issued its ruling: signatures are part of the public record. "By a strong majority Thursday, the Supreme Court issued a setback for opponents of gay marriage who wanted to keep their identities secret. The justices favored transparency over privacy in a case testing whether signing a petition is a public act. The case began with a bill that the Washington state legislature passed in 2009, expanding the state's domestic partnership law. The new referendum was known as 'everything but marriage' for the enhanced rights it gave same-sex couples. People who opposed the bill gathered 120,000 signatures for a ballot measure asking voters to repeal it. That measure eventually reached Washington voters, who upheld 'everything but marriage.' Those who signed the repeal petition feared that they would be harassed if their names became public, so they went to court challenging Washington's Public Records Act. They argued that signing a petition is speech that is protected from disclosure. But in Thursday's 8-1 ruling, the Supreme Court disagreed. 'Such disclosure does not, as a general matter, violate the first amendment,' Chief Justice John Roberts wrote for the court."

ASCAP Declares War On Free Culture, EFF

http://news.slashdot.org/story/10/06/25/2048216/ASCAP-Declares-War-On-Free-Culture-EFF?art_pos=20
"According to Drew Wilson at ZeroPaid and Cory Doctorow, the ASCAP (American Society of Composers, Authors and Publishers), a US organization that aims to collect royalties for its members for the use of their copyrighted works, has begun soliciting donations to fight key organizations of the free culture movement, such as Creative Commons, the Electronic Frontier Foundation, and Public Knowledge. According to a letter received by ASCAP member Mike Rugnetta, 'Many forces including Creative Commons, Public Knowledge, Electronic Frontier Foundation and technology companies with deep pockets are mobilizing to promote "Copyleft" in order to undermine our "Copyright." They say they are advocates of consumer rights, but the truth is these groups simply do not want to pay for the use of our music. Their mission is to spread the word that our music should be free.' (Part 1 and part 2 of the letter.) The collecting agency is asking that its professional members donate to its Legislative Fund for the Arts, which appears to be a lobbying campaign meant to convince Congress that artists should not have the choice of licensing their works under a copyleft license."

http://yro.slashdot.org/story/10/06/26/1349247/Creative-Commons-Responds-To-ASCAP-Letter?art_pos=8
"Drew Wilson at ZeroPaid has a followup to the story about ASCAP telling its members that organizations like EFF and Creative Commons are undermining copyright. A spokesperson from Creative Commons said, 'It's very sad that ASCAP is falsely claiming that Creative Commons works to undermine copyright. Creative Commons licenses are copyright licenses — plain and simple, without copyright, these tools don't even work.' He also said, 'Many tens of thousands of musicians, including acts like Nine Inch Nails, the Beastie Boys, David Byrne, Radiohead, and Snoop Dogg, have used Creative Commons licenses to share with the public.' Many ASCAP members are already expressing their disappointment with the ASCAP letter over at Mind the Gap. Sounds like ASCAP will be in damage control for a while."

Pakistan To Scour Google, Yahoo For Blasphemy

http://yro.slashdot.org/story/10/06/25/1811204/Pakistan-To-Scour-Google-Yahoo-For-Blasphemy?art_pos=24

"Pakistan will start monitoring seven major websites, including Google, Yahoo, and Amazon, for sacrilegious content, while blocking 17 other, lesser-known sites it deems offensive to Muslims, an official said Friday. The moves follow Pakistan's temporary ban imposed on Facebook in May that drew both praise and condemnation in a country that has long struggled to figure out how strict a version of Islam it should follow. ... 'If any particular link with offensive content appears on these websites, the (link) shall be blocked immediately without disturbing the main website,' [said Pakistan Telecommunication Authority spokesman Khurram Mehran]."
 I'm glad that we are past this stuff in western nations.

Friday, June 25, 2010

Oregon Trail Speed Runs



If you've been doing anything for the last week other than play Oregon Trail and sleep then you aren't living the dream.  I on the other hand have achieved a 9485 high score, and a finish date of April 15th (45 days).

Thursday, June 24, 2010

Julian Paul Assange

http://www.newyorker.com/reporting/2010/06/07/100607fa_fact_khatchadourian?currentPage=all

An article about Wikileaks founder Julian Paul Assange.  Along with that article Schneier's blog post (where I go the link), has some interesting stuff in the comments about Wikileaks. 

Traffic Deaths

http://roomfordebate.blogs.nytimes.com/2010/05/27/do-we-tolerate-too-many-traffic-deaths/

A bunch of articles on why we tolerate so many traffic deaths while fearing other things less likely to kill us.

Wednesday, June 23, 2010

The Obama administration and its pundit-defenders

http://www.salon.com/news/opinion/glenn_greenwald/2010/06/21/pundits/index.html
Even in the context of America's wretched civil liberties abuses over the last decade, the case of Mohamed Hassan Odaini stands out.  He was 17 years old in 2001 when his father sent him from Yemen to study at a religious university in Raiwand, Pakistan, and when a campus house in which he was staying there was raided by Pakistani authorities in early 2002, he was turned over to the U.S. and shipped to Guantanamo, where he has remained without charges for the last eight years (he's now 26).  A federal court this month granted his habeas petition for release, finding that the evidence "overwhelmingly supports Odaini's contention that he is unlawfully detained."  Worse, the court described the multiple times over the years -- beginning in 2002 and occurring as recently as 2009 -- when the U.S. Government itself concluded that Odaini was guilty of nothing, was mistakenly detained, and should be released (see here for the court's description of that history).
Despite that, the Obama administration has refused to release him for the past 16 months, and fought vehemently in this habeas proceeding to keep him imprisoned.  As the court put it, the Obama DOJ argued "vehemently" that there was evidence that Odaini was part of Al Qaeda.  In fact, the Obama administration knew this was false.  This Washington Post article this weekend quotes an "administration official" as saying:  "The bottom line is: We don't have anything on this kid."  But after Obama decreed in January that no Yemeni detainees would be released -- even completely innocent ones, and even though the Yemeni government wants their innocent prisoners returned -- Obama DOJ lawyers basically lied to the court by claiming there was substantial evidence to prove that Odaini was part of Al Qaeda even though they know that is false.  In other words, the Obama administration is knowingly imprisoning a completely innocent human being who has been kept in a cage in an island prison, thousands of miles from his home, for the last 8 years, since he's 18 years old, despite having done absolutely nothing wrong.

Tuesday, June 22, 2010

California Wants To Put E-Ads On License Plates

http://news.slashdot.org/story/10/06/21/026224/California-Wants-To-Put-E-Ads-On-License-Plates?art_pos=22&art_pos=22
"The San Jose Mercury News reports that the California state legislature wants to put electronic advertising on license plates. The plate would display standard plate information when the car is moving, but would also display ads when the car is stopped for more than 4 seconds (say, at a red light). Not distracting or annoying at all! 'The bill has received no formal opposition. It passed unanimously through the Senate last month and is scheduled to be heard Monday by the Assembly Transportation Committee.'"
This story in itself is ridiculous, but in the comments someone brought up this story:
http://www.freedomforum.org/templates/document.asp?documentID=15440
In 1974 a man got a $25 fine for covering up NH's "Live Free or Die" motto on his license plate.  The ACLU convinced him to sue because it violated his first amendment rights (and because apparently exquisite irony isn't reason enough).  Eventually the US Supreme Court ruled 6-3 in his favor.  NH in keeping with the highest "big baby" traditions, refused to pay $21k in legal fees.  A US marshal had to take a court order to a state owned liquor store and demand payment.

Man Stuck In Elevator For 41 Hours

http://www.youtube.com/watch?v=p_bMhNI_TY8

This is a pretty good article, not just about the guy being stuck, but about elevators in general.
http://www.newyorker.com/reporting/2008/04/21/080421fa_fact_paumgarten?currentPage=all

Sunday, June 20, 2010

Voting Methods

http://politics.slashdot.org/story/10/06/19/2116248/Cumulative-Voting-Method-Gaining-Attention?art_pos=9

Slashdot has a post about cumulative voting.  In cumulative voting you have multiple votes and distribute them however you want to the candidates.  Everyone might have 3 votes, or 10, or 100.  They can give all of them to one person, or divide them up however they want.  In theory this would help third parties.  However, in practice, I think it would do little.  People would just give all their votes to one person.  If people are afraid of voting for a third party now because of "throwing away your vote" then they will be against throwing away part of their vote.  Perhaps people would be more willing to give a small portion of their vote to their ideal candidate, while giving the majority to their realistic candidate.

A key to cumulative voting is that each person has just one total vote.  They can just split it up and give fractions of it to different people.  Instead I'd like to see a system where everyone can have multiple whole votes.  Create a simple chart, on the left is a list of candidates, next to each person's name is a box that can be checked.  People can check however many boxes as they want.  Each person with a checked box gets one whole vote.  This means people can have anywhere from 0 to n votes where n is the number of candidates.  The key is that any one candidate can only receive 1 vote, not all n votes.  That is the difference from cumulative voting.

At first giving people different amounts of votes seems like an unfair thing.  But everyone has the same potential number of votes, they just choose how many they want.  In practice, this would mean that people would vote for their realistic republocrat choice, and then also their ideal third party choice.  The total number of votes for republican or democrat likely wouldn't change.  But a large portion of people (perhaps well over half) would vote for a third party.

I do realize that in reality third parties may still not beat out the republocrats.  However, this wouldn't be because people wanted to vote for them but didn't.  Rather, it would be because people truly didn't know who they were and thus didn't vote for them.  This is opposed to the current situation, where even if 60% of people wanted a single third party candidate he may still lose because those people would be afraid of throwing away their votes.

Another system that would serve to help third parties, and is actually being used in most democracies is proportional representation.  Proportional representation requires that people are voting for multiple seats, i.e., some sort of legislative body.  In it people vote for parties instead of actual people.  The seats in the body are then divided up amongst the parties the same way the votes were.  In the US the House of Representatives could be voted like this.  If we kept 435 seats, and used the 2008 elections for data this is what the results would have been:
 
Party Votes Percent Current Seats New Seats Rounded Additional Total Seats Percent 
Democratic65,241,40854.11%257235.3923523554.02%
Republican52,184,38043.28%178188.2818818843.22%
Libertarian1,083,0270.90%03.91440.92%
Independent947,6610.79%03.423140.92%
Green570,7290.47%02.06220.46%
Constitution127,1270.11%00.460110.23%
Independence129,7470.11%00.470110.23%
Independent Oregon65,1090.05%00.23000.00%
Others216,1760.18%000.00%
Total120,565,364100.00%4354344323435100.00%

Republocrat got 97.4% of the votes, yet they hold 100% of the seats.  Thus 2.6% of people are completely unrepresented.  Keep in mind this is under the current system in which people often will not vote for a third party, even if that is who they want, because they don't want to throw away their votes.  If we actually switched to this system the third parties' numbers would rise quite a bit.

In the new system we take the total number of seats and multiply it by the percentage the party got.  For democrats that would be 435 * .5411 = 235.38 (the figure above is different due to more accurate numbers being used).  Then normal rounding rules are applied (>= 0.50 becomes 1, < 0.50 becomes 0)  So 235.38 becomes 235.  Due to rounding the total number of seats at this stage may not be exactly 435.  In this example it's 432.  You could simply allow the number of seats to change slightly from year to year.  Alternatively, if you want a constant total then you give out the additional seats in the logical fashion.  You take every party whose seat total was not already rounded up, and order them based on the fractional part of their seats.  In the above example that means Independence at 0.47, then Constitution at 0.46, then Independent at 3.42.  Since there are 3 extra seats those three would each get one more seat.  Alternativly, if you had more seats given out than you had available, then you would take back a seat from whichever party was rounded up the furthest.  In other words, if one party went from 0.51 to 1 they would lose that seat first.

People who know me may expect I'd have two issues with this voting system.  That it requires parties and that it ignores states.  The fact that it ignores states is fine.  The purpose of the House of Representatives represents the people, not the states.  You'd only have a problem if you tried doing this with the Senate.  As for it requiring parties, I will admit that the first time I read about this system that was an objection I had.  However, I can't ignore how well this system works at giving third parties a fair voice.  A possible solution would be to make creating a party as easy as possible.  That way people currently running as independents could simply start the Dale Swanson Party, and run under that.

The main problem with changing the way our election system works is that any change that threatens the republocrats currently in power will be opposed.  Either of the above systems would be fairer which would mean republocrats losing power to third parties.  Thus it will be opposed.  As the republocrats have nearly a total monopoly on government it is unlikely to change.

I've written before about a possible solution to this.  Allow someone else besides the legislative body in question decide the rules for how that legislative body is picked.  In the US this would probably mean letting the states decided how the US congress is elected.  A problem would be that the same parties that control the US congress control the state legislators.  As well as many state legislators aspire to be in the US congress at some point.

Perhaps some form of direct democracy could be used here.  Anyone could come up with an election system.  Get say 10,000 signatures on a petition, and then it would be included on the next US election.  That isn't ideal, but I don't know what else could be done.

Another step towards generally good things in government would be preventing corporate donations to politicians.  It's silly to think that anyone that receives millions of dollars from any entity wouldn't act with that entity's best interests in mind.  Yet, that is exactly how our current system works.  A fix could be as simple as this:  No one may serve in any political office who has received greater than $5,000 in gifts from anything other than a citizen in the district they are seeking to represent, over the last 10 years.  Again, humans don't have a great track record for making decisions that would hurt them personally but help the greater whole.  That is exactly what the current legislators would have to do to enact laws like these.

Dale Has Died Of Dysentery

Every once in a while I get a hankering to play some classic games.  Usually this is Sim City, or Sim City 2000.  Both are fairly easy to find.  However, I always have trouble finding a working version of the Oregon Trail.  Specifically, the Windows version I remember playing.  I found a well seeded torrent of it. 
http://btjunkie.org/torrent/Oregon-Trail-for-Windows-3-1-95-98-ME-XP-VISTA/4324ebdd22d06c5a667907c73f7051392ff09fe761a7

It's 119MB.  Unrar and just run ...\otrail\OTWIN32\OREGON32.EXE.

Also:
http://daleswanson.org/SimCity Classic.7z
http://daleswanson.org/SimCity 2000.7z

Saturday, June 19, 2010

Wikileaks Source Outed To Stroke Hacker's Own Ego

http://politics.slashdot.org/story/10/06/18/2146221/Wikileaks-Source-Outed-To-Stroke-Hackers-Own-Ego?art_pos=7
"Bradley Manning, the US Army private arrested recently by the Pentagon for providing classified documents — including the widely seen Apache helicopter videomay have been duped by wannabe hacker Adrian Lamo, according to Glenn Greenwald at Salon.com. Lamo told Manning he could provide protection under both journalist shield laws, and the clergy-lay confidentiality tradition, and instead immediately turned him in to authorities in an act of apparent shameless self-promotion." The article also goes into Wired's role in the whole situation, the strange, sometimes sensationalist media coverage, and the odd similarity between this case and proposed scenarios in a US Intelligence report from earlier this year aimed at undermining Wikileaks.
The article had a pretty interesting background on the guy that released this info as well as the guy that turned him in.
http://www.salon.com/news/opinion/glenn_greenwald/2010/06/18/wikileaks/index.html

Thursday, June 17, 2010

FCC Vote Marks Effort To Take Greater Control of the Web

http://politics.slashdot.org/story/10/06/17/2026205/FCC-Vote-Marks-Effort-To-Take-Greater-Control-of-the-Web
"The FCC voted today to open an inquiry into how the broadband industry is regulated, the first step in a controversial attempt to assert greater regulatory control over Internet service providers. In a 3-2 vote the Democratic members of the Commission voted to move forward with the FCC's proposal to reclassify broadband as a telecom service, increasing the regulation it is subject to. The move also has large implications for net neutrality, which FCC Commissioner Julius Genachowski has made a focus under his watch."

Wednesday, June 16, 2010

Geologists Might Be Charged For Not Predicting Quake

http://science.slashdot.org/story/10/06/16/214205/Geologists-Might-Be-Charged-For-Not-Predicting-Quake
"In 2009, a series of small earthquakes shook the region of L'Aquila, Italy. Seismologists investigated the tremors, but concluded that there was no direct indication of a big 'quake on the horizon. Less than a month later, a magnitude-6.3 earthquake killed more than 300 people. Now, the chief prosecutor of L'Aquila is looking to charge the scientists with gross negligent manslaughter for not predicting the 'quake."
This is a good way to encourage people to become geologists.  

Tuesday, June 15, 2010

Chatroulette Working On Genital Recognition Algorithm

http://tech.slashdot.org/story/10/06/15/1419224/Chatroulette-Working-On-Genital-Recognition-Algorithm?art_pos=11
Show them while you can, Internet exhibitionists. Chatroulette is working on image-recognition software that will filter out shots of male genitalia. The website's founder, Andrey Ternovskiy, hopes that blocking the offending members will help clean up Chatroulette's reputation. He's even enlisted the help of Napster founder Shawn Fanning. I wonder if someone has told Andrey how well it went for Napster?

The South Carolina Primary and Voting Machine Fraud

http://yro.slashdot.org/story/10/06/15/024231/The-South-Carolina-Primary-and-Voting-Machine-Fraud?art_pos=19
"South Carolina sure knows how to pick 'em. Alvin Greene is a broke, unemployed guy who is facing a felony obscenity charge. He made no campaign appearances and raised no money, but he is the brand new Democratic Senate nominee from South Carolina. Tom Schaller at FiveThirtyEight.com does a detailed analysis of how a guy like this wins a primary race, and many of the signs point to voting machine fraud. There seem to have been irregularities on all sides. 'Dr. Mebane performed second-digit Benford's law tests on the precinct returns from the Senate race. ... If votes are added or subtracted from a candidate's total, possibly due to error or fraud, Mebane's test will detect a deviation from this distribution. Results... showed that Rawl's Election Day vote totals depart from the expected distribution at 90% confidence. In other words, the observed vote pattern for Rawl could be expected to occur only about 10% of the time by chance. ... An unusual, non-random pattern in the precinct-level results suggests tampering, or at least machine malfunction, perhaps at the highest level. And Mebane is perhaps the leading expert on this very subject. Along with the anomalies between absentee ballot v. election day ballots..., something smells here.' Techdirt.com points out that South Carolina uses ES&S voting machines, which have had strings of problems before; and they have no audit trail."

This is a pretty big story, and you've probably already heard about it.  However, it is an interesting story.  While it is quite possible that he won simply because his name was first on the ballad, he is still an interesting person.
http://en.wikipedia.org/wiki/Alvin_Greene
The day after the primary election, the media reported that Greene was facing felony obscenity charges stemming from a November 2009 arrest for allegedly showing a pornographic picture on Internet site to an 18-year-old female University of South Carolina student and then allegedly said to her "Let's go to your room" in a computer lab.
Two points I have been unable to clarify.  First, what this porn was.  Second, if this is the federal obscenity law.   From what I've read it seems it was ordinary porn, and it is the federal law.  If that is true it is pretty strange.  The federal obscenity law is more or less a unconstitutional law that is rarely and randomly applied to very extreme porn.  Obscene has a legal definition that is different from merely offensive.  It is very unlikely he would be convicted of this law if it was just normal porn.  I have to guess there would be some sort of state law that applied to showing porn to random people (sexual harassment?) but maybe not.
Some commentators have raised questions about whether Greene paid the $10,440 filing fee out of his own funds, as required by law. Greene claims that he paid the filing fee by saving two years of his service pay. However, according to court records, Greene is currently being represented by a public defender in his obscenity case. South Carolina law requires defendants who want to be represented by the public defender's office to file an "affidavit of indigency" in order to prove they cannot afford to hire a lawyer. On this affidavit, the applicant must disclose all income and assets, including checking accounts.
This is also interesting.  And why the hell does it cost $10k to run for the Senate?

You'll Call Today

http://www.youtube.com/watch?v=4rqZZgVxnCk

Monday, June 14, 2010

Want To Be A Keyboard Snob?

http://www.overclock.net/computer-peripherals/491752-mechanical-keyboard-guide.html

$1 Trillion In Minerals Found In Afghanistan

http://news.slashdot.org/story/10/06/14/0652217/1-Trillion-In-Minerals-Found-In-Afghanistan
"American geologists working with the Pentagon have discovered deposits of iron, copper, cobalt, gold, and lithium of incredible bounty, amounting to nearly $1 trillion. In fact, the lithium deposits are so vast, an internal Pentagon memo has stated that Afghanistan could become the 'Saudi Arabia of lithium.' The wealth of the deposits completely flattens the current GDP of Afghanistan, estimated at about $12 billion. Mining would completely transform the economy of Afghanistan, which presently is propped up by the opium trade and foreign aid. However, it could take decades for extraction to reach its full potential due to the war, the lack of heavy industry in the country, and a corrupt national government."

Sunday, June 13, 2010

Saturday, June 12, 2010

Pentagon Seeking Out Wikileaks Founder Julian Assange

http://yro.slashdot.org/story/10/06/12/0250206/Pentagon-Seeking-Out-Wikileaks-Founder-Julian-Assange?art_pos=6&art_pos=6

"The Pentagon is desperately seeking the 'cooperation' of Wikileaks founder Julian Assange, in order to stop him from releasing over 250,000 pages of confidential foreign policy documents. The documents were allegedly provided to Assange by Bradley Manning, the same solider who leaked a video showing a US Army helicopter killing unarmed civilians and international press correspondents."

Thursday, June 10, 2010

Federal Judge Limits DHS Laptop Border Searches

http://yro.slashdot.org/story/10/06/10/198234/Federal-Judge-Limits-DHS-Laptop-Border-Searches?art_pos=4
Declan McCullogh is reporting at CNET that a federal district court judge has rebuked the Department of Homeland Security, "which had claimed it can seize a traveler's laptop and search it six months later without warrant." As described in the article, DHS policies have been stacked against travelers entering the US, including citizens returning from abroad: "There's no requirement that they be returned to their owners after even six months or a year has passed, though supervisory approval is required if they're held for more than 15 days. The complete contents of a hard drive or memory card can be perused at length for evidence of lawbreaking of any kind, even if it's underpaying taxes or not paying parking tickets." This ruling does not address immediate searches at the border, but says that DHS cannot hold computers for indefinite searching, as in the case to hand, concerning a US citizen returning from a trip to Korea, whose laptop was seized and held for months before a search was even conducted on it.

Wednesday, June 9, 2010

Genres

So I've been using XBMC to listen to music more.  With that I've become interested in party mode and smart playlists.  My year data is pretty good in my tags, but my genres have always been terrible.  I used to classify everything as either hardcore, heavy metal, or hard rock.  But abandoned that long long ago.  Recently I found the last.fm API.  I really like APIs, especially on user generated data.  The genre data was ideal for tagging my mp3s.  As an example of what you can get from the last.fm API:
http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Manowar&api_key=b25b959554ed76058ac220b7b2e0a026

And that is just band data, they have a bunch of different requests for different sets of data.  Concerning genres they have them for either band, album, or song.  Originally, I figured song would be too specific and band too broad.  Album seemed like the best choice.  However, once I began looking at the album tags they seemed too arbitrary.  I convinced myself that just doing per band genres would be best.  While the general info API has genre data, they have a different API call just for genres:
http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=horse%20the%20band&api_key=b25b959554ed76058ac220b7b2e0a026

That lists all the genres a band has, with the count, sorted from most popular to least.  It was ideal for what I was doing.  I knew from an earlier adventure with the last.fm API that my usual method for pulling data from the web, i.e., lynx, wouldn't work here.  Lynx attempted to parse the XML, while I wanted the raw unformatted XML data.  That meant going with wget, which I rarely use.  While there are no shortage of wget binaries compiled for Windows I found one that I liked and I recomend:
http://users.ugent.be/~bpuype/wget/

Once you have wget you need to put the executable either in the same directory as you are trying to call it from or in your Windows root (C:\WINDOWS\system32) so it can be called from any directory.  Once it's there downloading a webpage is done with this command:
wget "http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags&artist=Yes&api_key=b25b959554ed76058ac220b7b2e0a026" -O tags.xml

It was then a simple matter of making a perl script to find band names (based on directory names), download genre data with wget and then add that data to the tags via some sort of as yet unknown CLI tagging program.

It was around this time that the problems began to creep up.  Whenever I have to interface with the Windows command line from a perl script it's a nightmare.  The problem is there are nurmerous differences in how Windows and *nix handle things.  A good example would be backslash \ vs forward slash / for directories.  While that may not seem like much it is just one of many subtle differences that need to be accounted for.  Combine this with the fact that Windows isn't consistent if you enter commands directly on the CLI (or via system call in perl) or via a batch file, and it makes working out the interface between perl and Windows the longest part of the project.

If you ever find yourself doing something like this, I recommend having perl create a batch file and then run that.  This is nice because you can easily test the batch file by manually creating it.  Once you find the correct format to do what you want, it is easy to get perl to output your data formatted into a batch file.

In this case though, using a batch file added another difficulty.  I needed to escape certain characters for URLs (& to %26).  While *nix uses % to indicate a hex value, batch files use it for variables.  Thus all the percent signs needed to be escaped themselves to %%.  Getting data to output just right to work for the requests was a very tedious process.  However it was blown away by actually trying to write the data to the tags.

As you probably already know tag data in mp3s is a mess.  For mp3s there are 3 independent tagging formats, ID3v1, ID3v2, and APEv2.  ID3v1 is more or less worthless and deprecated.  It has a pretty short limit on the data length.  Despite the name ID3v2 isn't a second version of ID3v1, but rather a completely different format.  It has subversions ID3v2.2, ID3v2.3, and ID3v2.4.  Despite 2.4 coming out in 2000 some music players don't support it.  Lastly, APEv2 is my preferred format.  There is an APEv1, but it is rare enough that it can be ignored.  All these tag types can have conflicting data.  Which your music player displays will depend on what order of preference it has. 

For some naive reason I assumed finding a way to add tags via a CLI would be easy.  It was not.  I use Mp3tag for all my tagging needs, and it works very well.  For some reason it does not have a CLI.  I began searching for a simple tagging program with a CLI.  I found a few, and settled on one that seemed to work well.
http://www.synthetic-soul.co.uk/tag/
Despite its claims I couldn't get it to write anything besides APE tags.  Getting the tags written correctly was a very long process.  It seems if there wasn't already an APE tag it would create one and fill in all the fields using the ID3v1 data.  That meant that everything was cut off.  The solution was to use Mp3tag to ensure that everything already had APE tags, so that the tag CLI would just overwrite the genre field.  I'd then use Mp3tag to overwrite the ID3 tags with the APE data.

Also I had to do ogg/m4a/wma manually (as a side note the fact that I still can't get good copies of the stuff I have in m4a and wma is the bane of my existence).

The next issue was how to separate the different genres in the tags.  It turns out ID3v2.3 uses a semicolon ; while ID3v2.4 uses a null \0.  I preferred the null, since it was more logical, and foobar2000 formatted things much more nicely when using it.  A new interesting problem developed when I decided to use nulls though.  It is impossible to pass a null to a program as a parameter.  Strings are null terminated.  So when a program sees a null that is the end of the string.  So it was impossible to pass the genres with nulls to my CLI tagger.  Now it is possible to get around this if the program used some method to escape nulls.  For example it could convert any \0 it sees into a null.  You'd think a program made to write tags, which use nulls as deliminators would at least address nulls, but it didn't.

Luckily it turns out that spiting a field by a deliminator is a pretty common feature.  Both Mp3tag and Foobar2000 could do it.  The solution then was to separate the genres with a semicolon and then split them with Mp3tag.  In retrospect it may have been easier to simply write the tag data myself with perl.  I may try to do just that for future use.

After solving those two problems wrapping the whole thing up in a perl was easy.  The final program scans directories (non recursively) and treats all directory names as band names.  It then pulls the genre data and creates a single batch file that will use tag CLI to write the tag data to every file in each directory.  Before writing the data you should review the batch file and make sure all the tags make sense.

The script is on my site at the end of the perl section.
http://daleswanson.org/programs.htm#Perl

2 In 3 Misunderstand Gas Mileage; Here's Why

http://tech.slashdot.org/story/10/06/08/2158202/2-In-3-Misunderstand-Gas-Mileage-Heres-Why

"OK, so here's a little test: Which saves more gasoline, going from 10 to 20 mpg, or going from 33 to 50 mpg? If you're like most Americans, you picked the second one. But, in fact, that's exactly backwards. Over any given mileage, replacing a 10-mpg vehicle with one that gets 20 mpg saves five times the gasoline that replacing a 33-mpg vehicle with one that gets 50 does. Last summer, Duke University's Fuqua School of Business released a study that shows how much damage comes from using MPG instead of consumption to measure how green a car is. Management professors Richard Larick and Jack Soll's experiments proved that consumers thought fuel consumption was cut at an even rate as mileage increased."

Friday, June 4, 2010

Lossy Compression

So this guy recorded himself talking in a room.  Uploaded it to Youtube, then ripped it, and then reuploaded the ripped version.  He did this 1000 times.  Every time the lossy video and audio compression degraded the quality.  The results are pretty sweet.  They are also a good example of why you shouldn't convert audio or video between lossy formats.

http://www.youtube.com/watch?v=jEIzS_27Vt0 - Original
http://www.youtube.com/watch?v=U5RWe1YGSaQ - 100th
http://www.youtube.com/watch?v=8qKz5YW5J-U -1000th (turn sound down)

PA Appeals Court Weighs Punishment For Students' Online Parodies

http://yro.slashdot.org/story/10/06/04/0359210/PA-Appeals-Court-Weighs-Punishment-For-Students-Online-Parodies

"Is it a student's right to free speech or a school's right to discipline? A US Appeals Court in Pennsylvania heard arguments Thursday on a case that could have far-reaching implications. The issue involves the suspension of two students, from two different Pennsylvania school districts, for web postings they made on their home computers. The students posted parody profiles on MySpace that mocked their principals. The American Civil Liberties Union argued on behalf of the students."
In what bizarre alternate universe does a school have rights?  Rights are something that humans have by default.  We create various governments and other entities to prevent others from impeding upon our rights as well as for our general benefit.   None of these non-human entities have rights though; they only have powers and privileges we grant them to benefit ourselves.

Guess My Speed and Give Me a Ticket, In Ohio

http://yro.slashdot.org/story/10/06/03/2133222/Guess-My-Speed-and-Give-Me-a-Ticket-In-Ohio

"The Ohio Supreme Court has ruled that police may estimate your car's speed and issue a ticket if they believe you were speeding. The hearing threw out a radar gun as evidence because the officer was not qualified to use it, but apparently his guess was good enough. If you make your way into Ohio, I suggest driving 5mph under the speed limit because this leaves little room to dispute your ticket in court. The only chance you have is if the issuing officer decides to skip your hearing." I wonder whether the court would also accept a driver's own GPS log as exculpatory evidence.

Police Officers Seek Right Not To Be Recorded

http://yro.slashdot.org/story/10/06/03/1548225/Police-Officers-Seek-Right-Not-To-Be-Recorded

"When the police act as though cameras were the equivalent of guns pointed at them, there is a sense in which they are correct. Cameras have become the most effective weapon that ordinary people have to protect against and to expose police abuse. And the police want it to stop. Judges, juries, and legislatures support the police overwhelmingly on this issue, with only a few cases where those accused of 'shooting' the cops being vindicated through the courts."
In response to a flood of Facebook and YouTube videos that depict police abuse, a new trend in law enforcement is gaining popularity. In at least three states, it is now illegal to record any on-duty police officer.

Bill Gives Feds "Emergency" Powers To Secure Civilian Nets

http://news.slashdot.org/story/10/06/03/038203/Bill-Gives-Feds-Emergency-Powers-To-Secure-Civilian-Nets

"Joe Lieberman wants to give the federal government the power to take over civilian networks' security if there's an 'imminent cyber threat.' From the article: 'Lieberman and Collins' solution is one of the more far-reaching proposals. In the Senators' draft bill, "the President may issue a declaration of an imminent cyber threat to covered critical infrastructure." Once such a declaration is made, the director of a DHS National Center for Cybersecurity and Communications is supposed to "develop and coordinate emergency measures or actions necessary to preserve the reliable operation, and mitigate or remediate the consequences of the potential disruption, of covered critical infrastructure."'"
Any guesses on how long before omnipresent child porn is an "imminet cyber threat"?

Thursday, June 3, 2010

Oil Spill Infographic

http://www.nytimes.com/interactive/2010/05/25/us/20100525-topkill-diagram.html

The NYTimes has a good infographic on the Deepwater Horizon oil spill.  It details the different methods that have been tried so far to stop the leak.  Look at the other tabs for info on the spread and effects of the oil.

Wednesday, June 2, 2010

Caffeine Addicts Get No Additional Perk, Only a Return To Baseline

http://science.slashdot.org/story/10/06/02/219229/Caffeine-Addicts-Get-No-Additional-Perk-Only-a-Return-To-Baseline

"Bristol University researchers found that drinkers develop a tolerance to both the anxiety-producing and the stimulating effects of caffeine, meaning that it only brings them back to baseline levels of alertness, not above them. 'Although frequent consumers feel alerted by caffeine, especially by their morning tea, coffee, or other caffeine-containing drink, evidence suggests that this is actually merely the reversal of the fatiguing effects of acute caffeine withdrawal,' wrote the scientists, led by Peter Rogers of Bristol's department of experimental psychology."
This is rather obvious.  But, as I really don't like caffeine I felt the need to post it.

How a Virginia Law Firm Outpaces the MPAA at Suing Over Movie Downloads

http://yro.slashdot.org/story/10/06/02/1532223/How-a-Virginia-Law-Firm-Outpaces-the-MPAA-at-Suing-Over-Movie-Downloads

Jamie points out this Ars Technica piece on a series of suits brought by the Virginia law firm of Dunlap, Grubb & Weaver against users they accuse of illegally downloading movies. The firm has an interesting business model in these suits; sue enough users in a DC Federal court to be worth splitting the sum of many small settlement offers (generally $1,500-2,500 apiece) with the filmmakers, rather than rely on winning after trial a small number of larger judgments. Most people settle, and Dunlap, Grubb & Weaver has so far named more than 14,000 "Does" — as in John Doe — including, as mentioned a few days ago,5,000 who downloaded The Hurt Locker.