Why Not Just Make Better Products?
Posted on: April 6, 2013
- In: Geeky
- Leave a Comment
“Thorstein Veblen wrote that it is the essential task of the business executive to ever-advance sharp practice into the territory previously understood as crime.”
Wired writer David Mamet’s pithy summary seems to nicely capture whats going on in the executive suites of Microsoft lately. The company is becoming an increasingly problematic player in the tech industry, turning number of practices like patent trolling and astroturfing into actual lines of business while its product line flounders.
In 2011 US hardware and software companies were forced to spend $29.2 billion in 2011 to defend themselves from patent trolls, a cost that is, of course, simply passed on to the consumer. As Bloomberg points out Microsoft is using these “patent privateers” to attack Google and Apple:
To harry other nations without attacking them, monarchs like England’s Elizabeth I commissioned ship captains to plunder merchant vessels, creating a type of pirate known as a privateer.
The term is used today to describe businesses that obtain patents from technology companies and then file infringement lawsuits against the sellers’ competitors.
Tech companies use privateers to distract their adversaries or collect royalties on the patents without provoking retaliatory litigation, said Ron Laurie, managing director of Inflexion Point Strategy LLC in Palo Alto, California.
Nokia Oyj (NOK), Microsoft Corp. (MSFT) and Alcatel-Lucent are among companies connected with these licensing firms.
In addition, attacking rivals via patent trolls, Microsoft has taken to trolling directly, approaching Android handset manufacturers and threatening them with endless litigation unless they pay up. The similarity between patent trolling and business model of the mafia is hard not to notice and its one that was actually pioneered by Microsoft’s former CTO.
Now we have Microsoft itself engaging in it more and more. As noted in the Bloomberg article “Five years ago, any connections with patent-assertion companies reflected poorly, now that’s kind of history and everyone’s singing ‘How can I get in on this action?’”
Microsoft now makes more off of Android phones that it does off of Windows phones. This strange situation pretty much ensures that things will get worse as they look for ways of increasing that revenue stream.
When they are not feeding the patent trolls, or being one themselves, Microsoft seems to be spending millions astroturfing, trying to bait the government into suing Google. As Readwrite.com’s Dan Lyon puts it:
For years Microsoft has devoted massive resources and energy to waging a sneaky shadow war against Google, fielding an army of lobbyists and front groups that exist almost completely to spread anti-Google propaganda, including ICOMP.org, the Association for Competitive Technology, FairSearch and SafeGov.
They call themselves “industry groups,” and they have lots of members, but they’re basically Microsoft fronts devoted to hating on Google.
That article is a pretty eye-opening even if you were already aware of Microsoft past shady business practices. It also mentions that Mark Penn, the man behind the Facebook’s Google smear campaign and who is bringing political attack ads to the tech world (and who reports directly to Steve Ballmer) “has been going around Washington trying to recruit consultants, telling them that Microsoft has armed him with a $50 million budget to go after Google”.
Shockingly, none of this is shocking for those who follow the company closely. Asked about Microsoft’s new advertising efforts, Michael Cusumano, a professor at the MIT’s Sloan School of Management who has been writing about Microsoft since the 90s simply said “Nothing is below Microsoft. They have been playing dirty for a long time”.
So as good as that article is, its “Why Not Just Make Better Products?” conclusion sounds pretty naive. Gaming the system is increasingly common as a mainstream business strategy regardless of which industry you look at (look into “regulatory capture”). I think the only real solution is to make the system harder to game.
Google has taken a step in that direction by creating a “prior art search tool”. StackExchange has also made a site to crowdsource the search for prior art. Both of these efforts aim to give patent examiners better tools in hopes that this will reduce the number of bad technology patents that are currently streaming out of the USPTO.
The astroturfing problem is a largely hidden epidemic and will probably need a browser functionality similar to Google’s Safe Browsing Techonology to even raise that issue into the public consciousness.
Fundamentally, the answer to the question “Why Not Just Make Better Products?” is because getting good products into peoples hands is hard. Sadly the current business environment makes it easier and potentially more profitable to focus on other strategies. Microsoft’s clearly chosen to increase the risk (patent litigation), expense (Internet Explorer, patent licencing) and complexity (UEFI) of everything else so their own products (however risky, expensive and complex) seem like a bargain.
Until the incentives change we can expect Microsoft to keep advancing into territory previously understood as crime.
In 1989 Francis Fukuyama published the essay “The end of history?” which says:
What we may be witnessing is not just the end of the Cold War, or the passing of a particular period of postwar history, but the end of history as such: that is, the end point of mankind’s ideological evolution and the universalization of Western liberal democracy as the final form of human government.
I am not the first to notice that the programming world seems to be undergoing a similar shift, with the universalization of Javascript and its seeming adoption as the final form of programming.
The Mozilla platform (XUL, XPCOM, etc…) has long made it possible to develop desktop applications in Javascript (Firefox most famously) but radical changes have been afoot. Microsoft and the Gnome Foundation have both made Javascript their a central development language. On the mobile front Apache Cordova (formerly Phonegap), Firefox OS and other projects are ensuring steady growth of Javascript there.
Of course Node.js means that your server side code can now be written in Javascript as well. If you are wondering if how that is going, consider that Modulecounts reports that the npm package repository is growing faster even than Rubygems. On top of all that HTML 5 and standards like WebRTC and WebGL ensure that Javascript grows ever more powerful in the browser as well.
This is a curious shift to watch. Javascript is a pretty surprising choice for the “final form” of programming but here it is anyway, its adoption driven presumably by the number or programmers familiar with it from working with the DOM. Microsoft’s adoption seems is doubly curious; what would be the difference between Firefox OS and Windows when all/most apps are written in Javascript? It’s as though they are embracing Marc Andreessen’s famous prediction that “Windows will just be a buggy set of device drivers” and adding “and a Javascript API!”.
Does all this really spell the end for other languages? Is Javascript really taking over the world? It’s hard not to feel that way.
The famous philosopher Slavoj Žižek points out that where we used to see demands for Western-style democracy after every introduction of capitalism (and thus thought there was causation not just correlation), we are starting to see capitalism appear in stronger forms without democracy, giving a new form of political organisation. What he is getting at is that Fukuyama was wrong, history marches onwards after all.
When I look at projects on the border between Javascript and Ruby where authors are pressing each languages strengths and compensating for weaknesses, I think there is plenty more history to come in the world of programming. It just looks like the path to get there is going to be dominated by Javascript.
- In: Geeky | ruby
- Leave a Comment
I have 7 teachers in my immediate family and a step-mother that is teaching literacy and computer skills in Africa. Personally I have taught computer classes for seniors, and recently volunteered as a Ruby mentor with Ladies Learning Code in addition to sharing what I have learned with friends and loved ones. Teaching is a pretty big part of my world and consequently teaching programming has been on my mind a fair bit.
Lately I have started building some tools to support the ideas I have been rolling around and thought I would sketch out a rough lesson plan for someone’s first experience with Ruby that connects the ideas to the tools. I am putting it up here in hopes of getting some feedback and that it might be helpful to others.
Two things I have read really shaped my thinking about how learning happens and therefore how teaching should be done. The first is a brilliant article called The Cognitive style of Unix. The insight there is that “helpful” GUI software actually interferes with the process of internalizing the set of rules that govern the task at hand.
The second is this paragraph from Nicolas Carr’s book The Shallows:
Purely mental activity can also alter our neural circuitry, sometimes in far-reaching ways. In the late 1990s, a group of British researchers scanned the brains of sixteen London cab drivers who had between two and forty-two years of experience behind the wheel.
When they compared the scans with those of a control group, they found that the taxi drivers’ posterior hippocampus, a part of the brain that plays a key role in storing and manipulating spatial representations of a person’s surroundings, was much larger than normal.
Moreover, the longer a cab driver had been on the job, the larger his posterior hippocampus tended to be. The researchers also discovered that a portion of the drivers’ anterior hippocampus was smaller than average, apparently a result of the need to accommodate the enlargement of the posterior area.
Further tests indicated that the shrinking of the anterior hippocampus might have reduced the cabbies’ aptitude for certain other memorization tasks. The constant spatial processing required to navigate London’s intricate road system, the researchers concluded, is “associated with a relative redistribution of gray matter in the hippocampus.”
What I am seeing in this paragraph is that quality of explanation only counts for so much, learning is mostly a biological process. We are not waiting for a “Eureka!” moment, we are stimulating the growth of new biological material. That takes time and repetition.
With those things in mind, it seems to me that the goal when trying to teach something like Ruby is to explain as clearly as possible the rules that govern that world with plenty of opportunities for repetition. A key part of making repetition happen aiming to make the learner autonomous as quickly as possible.
Theory is great but what would implementation look like? From my experience it seems there are two distinct “worlds” whose rules must be internalized for someone to start feeling comfortable with Ruby, the Unix command line and Ruby itself.
Learning the command line:
Have given a few people their first look at a command line, I have noticed that it is difficult for them to understand what it is they are looking at. They are thrust into a black and white world (aubergine and white if you are on Ubuntu) with no indication of what to do next. Relevant terminology to define at this point would be path, command/program and probably variable. Then you can focus on the rules that govern this world; the command line equivalent of physics. First it seems to need to understand what running a program looks like since that is the root of everything:
Following that general structure offers a template that learners should be able use to understand things like:
cd cat ~/Documents/foo.txt ls -al grep -ri kittens .
The other rule that shapes this world is that all programs are searched for, and hopefully found, in one of the folders that is contained (in a comma separated list) in a variable called $PATH. Even though the echo command is unfamiliar, learners should have some intuition about the meaning of:
echo $PATH
A few experiments with the “which” command (ex: which ls) should go a long way to helping internalize the rules of this world and build a set of expectations that will help learners understand output like:
mike@sleepycat:~☺ blah No command 'blah' found, did you mean: Command 'blam' from package 'blam' (universe) blah: command not found
All of this information is really just building towards allowing learners to understand the following statements:
mike@sleepycat:~☺ ruby -e "puts 'hello world'" mike@sleepycat:~☺ ruby ./hello_world.rb
With that we have a toehold in a new world and can work on understanding the rules that govern that.
Learning Ruby:
Teaching beginners Ruby is tough because you are constantly walking a fine line between providing accurate information and glossing over overwhelming detail. This part is a little less clearly defined, partly because of the complexity, partly because I am still exploring the ideas. One thing is clear to me though: because everything is an object in Ruby there is no way to duck the difficult topic of classes and objects. You have to deal with it pretty much right away.
Unfortunately it’s fairly common to start with something like this: 
I say unfortunately because it has already raced past the basics physics of the Ruby world: on every line you will see some variation of thing dot action.
___________.__________()
Once learners have taken a long look at that basic structure then they should be able cope a little better with looking at an actual line of Ruby. Pressing home that point we could now use that dog image to highlight the basic structure: .new(), .look_alert() and .sit() are all behaviours known as methods attached to the object on the left of the dot. Things on the left of a dot are either a blueprint or an thing made from a blueprint.
The seeming exceptions to this rule where behaviour seems to happening without an object (think puts and all the other Kernel methods included in the main object) are because we are inside an object and that object (aka self) is the one understood to be receiving that call to action. Most likely it is preferable to opt for specifying things like puts in its more verbose form Kernel.puts.
With that information learners should be able to make sense of the following examples:
mike@sleepycat:~☺ ruby -e "Kernel.puts 'hello world'"
mike@sleepycat:~☺ ruby -e "Kernel.loop {Kernel.puts 'hello world'}"
mike@sleepycat:~☺ ruby -e "Kernel.puts(Kernel.eval('1 + 1'))"
mike@sleepycat:~☺ ruby -e "Kernel.puts(Kernel.gets())"
Note that all of those are run with the Ruby command to reinforce the earlier learning of the command line. However after each command is run we are kicked rudely out of the world of Ruby but if we combine them we can stay inside it:
mike@sleepycat:~☺ ruby -e "loop { puts(eval(gets())) }"
That little bit of genius (which I have written about before) is taken directly from Josh Cheek and is a brilliant way to demystify what is often (unfortunately) the peoples first step into Ruby, playing with IRB. Now with a little grounding learners should be able to make sense of what they see there.
Exploring further:
IRB suffers the same problem as the command line: there is no obvious way to discover what to do. There is tonnes of information that would be useful to building a clear mental model of how the world of Ruby works but none of it is readily accessible to beginners. I decided to take a stab at fixing this by creating a gem called explore_rb.
It adds methods to the main object to display all available classes, all objects in memory and a few other things. Since being dropped into IRB is a lot like being shut in a darkened room, those methods allow you to explore the contents of the room. For a description of its methods you can see the readme.
We can use explore_rb to show the differences between classes and objects (the difference between a blueprint and something made using that blueprint):
mike@sleepycat:~☺ irb irb(main):001:0> require 'explore_rb' Use the following commands to look around: classes, objects, get_objects, symbols, local_variables, gems, draw_this, help => true irb(main):002:0> classes.include? :Cat => false irb(main):003:0> get_objects Cat NameError: uninitialized constant Cat from (irb):4 from /home/mike/.rbenv/versions/2.0.0-p0/bin/irb:12:in `<main>' irb(main):004:0> class Cat; end => nil irb(main):005:0> classes.include? :Cat => true irb(main):006:0> get_objects Cat => [] irb(main):007:0> Cat.new => #<Cat:0x007f8c411c49c0> irb(main):008:0> get_objects Cat => [#<Cat:0x007f8c411c49c0>] irb(main):009:0> Cat.new => #<Cat:0x007f8c411cf870> irb(main):010:0> get_objects Cat => [#<Cat:0x007f8c411c49c0>, #<Cat:0x007f8c411cf870>]
Additionally explore_rb can help visualize the execution of our programs. This is a big help when explaining functions/methods and return values. An example would be:
irb(main):022:0> class Cat
irb(main):023:1> def initialize name
irb(main):024:2> @name = name
irb(main):025:2> end
irb(main):026:1> def name
irb(main):027:2> @name
irb(main):028:2> end
irb(main):029:1> def vocalize
irb(main):030:2> "#{name} says miaow"
irb(main):031:2> end
irb(main):032:1> end
=> nil
irb(main):033:0> cat1 = Cat.new("Chatoune")
=> #<Cat:0x007f39f74c1818 @name="Chatoune">
irb(main):034:0> draw_this { cat1.vocalize }
File saved in /home/mike/Desktop.
=> nil
Which gives us the following image:

Now we have a visual showing the interpreter moving in and out of our methods. You can see it will drop into a method to process the instructions within and return from the method.
We can see it drop into the vocalize method, and then have to drop down into the name method to carry out the instructions there before returning to complete the sentence that vocalize is supposed to return.
At this point I think things get more free form and as long as the emphasis is on building up a solid set of expectations around how the world of Ruby works its really up to the mentor to read their audience and give them what they need. Ruby is a great language in terms of consistancy since it was designed from the ground up to be object oriented, rather than having object orientation grafted awkwardly on later, so that should really help the learning process.
While there are exceptions and caveats for everything I have said above I think exposing people to exceptions before they have internalized the rule can only damage the learning process. Where exceptions to the rules are revealed through experimentation (“why doesn’t ‘which cd’ return anything?”, “if I create objects with .new and 1 is an object why can’t I say Fixnum.new(1)?”) emphasising the what expectations still hold true is probably the most important thing you can do. It takes a lot of learning before you can appreciate stuff like this.
If you have something that has really helped your learning process let me know in the comments.
XUL with HAML?
Posted on: February 13, 2013
I was playing around with XUL today. I was modifying a my ffkiosk application I made a little while ago and experimenting with adding some buttons and a toolbar to it. While XUL is relatively simple stuff, I find its pretty verbose, and as an on and off user of HAML, I also find it ugly.
Then it hit me; I wonder if you can use HAML to write XUL?
The answer is yes:
!!! xml
<?xml-stylesheet href="chrome://ffkiosk/skin/main.css" type="text/css" ?>
%window{id: "main", title: "ffkiosk", onload: "onload();", sizemode: "fullscreen", height: "768", width: "1024", xmlns: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"}
%script{type: "application/javascript", src: "chrome://ffkiosk/content/jquery-1.7.2.js"}
%script{type:"application/javascript", src: "chrome://ffkiosk/content/io.js"}
%script{type: "application/javascript", src: "chrome://ffkiosk/content/main.js"}
%toolbar
%toolbaritem
%toolbarbutton{label: "I'm a button"}/
%toolbaritem
%toolbarbutton{label:"Foo", type:"menu-button"}
%menupopup
%menuitem{label: "Bar"}/
%menuitem{label: "Baz"}/
%browser{id: "browser", type: "content-primary", flex: "1"}/
Apart from the xml-stylesheet line which HAML can’t deal with (but cheerfully lets pass through) it works really well. The output is totally legit XUL:
<?xml version='1.0' encoding='utf-8' ?>
<?xml-stylesheet href="chrome://ffkiosk/skin/main.css" type="text/css" ?>
<window height='768' id='main' onload='onload();' sizemode='fullscreen' title='ffkiosk' width='1024' xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>
<script src='chrome://ffkiosk/content/jquery-1.7.2.js' type='application/javascript'></script>
<script src='chrome://ffkiosk/content/io.js' type='application/javascript'></script>
<script src='chrome://ffkiosk/content/main.js' type='application/javascript'></script>
<toolbar>
<toolbaritem>
<toolbarbutton label="I'm a button" />
</toolbaritem>
<toolbaritem>
<toolbarbutton label='Foo' type='menu-button'>
<menupopup>
<menuitem label='Bar' />
<menuitem label='Baz' />
</menupopup>
</toolbarbutton>
</toolbaritem>
</toolbar>
<browser flex='1' id='browser' type='content-primary' />
</window>
Sure enough XULRunner happily renders it:

At the moment I can’t decide if this is a great idea or totally ridiculous. Hell, I know plenty of people that think that any usage of HAML is ridiculous. I can imagine with a complex UI the typing saved and the clarity gained might be worth it… until someone points out a decent XUL IDE.
An interesting experiment if nothing else.
Ruby Redo’s: Sinatra
Posted on: February 7, 2013
- In: rails | ruby | ruby redos | sinatra
- Leave a Comment
Sinatra is described as “a DSL for quickly creating web applications” and since I have been playing with DSLs lately I thought I would try my hand at making something like it. You can see in Sinatra’s famous three line “Hello World” that they are calling get directly on the top-level object called main:
require 'sinatra' get '/hi' do "Hello World!" end
So first thing we know is that we need a Rack compatible class. Why do we know that? Because Rack deals with the webserver/HTTP stuff as long as we follow their interface spec which saves us a lot of fussing with servers. The spec is simple:
A Rack application is a Ruby object (not a class) that responds to call. It takes exactly one argument, the environment and returns an Array of exactly three values: The status, the headers, and the body.
So that actually tells us a fair bit about the class we need to write. As the saying goes, “There are only two hard things in Computer Science: cache invalidation and naming things”, I think I will name this thing HTTP. So here is the minimum to conform with the Rack spec:
class HTTP
def call env
[200, {}, ""]
end
end
If you are curious about what kind of stuff is going to end up in that env variable here is an example:
{
"SERVER_SOFTWARE"=>"thin 1.5.0 codename Knife",
"SERVER_NAME"=>"localhost",
"rack.input"=> StringIO.new(),
"rack.version"=>[1, 0],
"errors"=>STDERR,
"rack.multithread"=>false,
"rack.multiprocess"=>false,
"rack.run_once"=>false,
"REQUEST_METHOD"=>"GET",
"REQUEST_PATH"=>"/test",
"PATH_INFO" => "/test",
"REQUEST_URI"=>"/test",
"HTTP_VERSION"=>"HTTP/1.1",
"HTTP_USER_AGENT"=>"curl/7.27.0",
"HTTP_HOST"=>"localhost:8080",
"HTTP_ACCEPT"=>"*/*",
"GATEWTERFACE"=>"CGI/1.2",
"SERVER_PORT"=>"8080",
"QUERY_STRING"=>"",
"SERVER_PROTOCOL"=>"HTTP/1.1",
"rack.url_scheme"=>"http",
"SCRIPT_NAME"=>"",
"REMOTE_ADDR" => "127.0.0.1"
}
Rack actually has a bunch of helpful classes that we are going to use to get thing working, lets add them in:
require 'rack'
class HTTP
def call env
request = Rack::Request.new env
response = Rack::Response.new
response.write "Hello Whirled"
response.finish
end
end
at_exit do
Rack::Handler.default.run HTTP.new
end
You can see that we now have request (that wraps the environment hash that you can see us passing in) and a response object. Notice that response.finish is the last line of the call method now. This is because it returns the array of status, headers and body that Rack needs. The other thing to notice is that we are using Kernel#at_exit to run whatever Rack decides is the default webserver when the script exits. This actually gives us a working application that you can run like this:
mike@sleepycat:~/play/http$ ruby http.rb
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:8080, CTRL+C to stop
Lets take another step and get that response.write out of there and put it in a Proc. Next, we use instance_eval to evaluate the Proc (which is being turned from a proc object back into a block with the & operator) in the context of the current object. Since the block is being evaluated in the context of the current object and not the context of the current method we need to make request and response instance variables and add some attr_accessor methods. You can see also that we are now storing the routes in a hash of hashes that is held in a class variable so that when we call new, our instance can still see the routes.
require 'rack'
class HTTP
attr_accessor :request, :response
@@routes = { get: {"/" => Proc.new {response.write "Hello Whirled"}} }
def call env
@request = Rack::Request.new env
@response = Rack::Response.new
the_proc = @@routes[:get]["/"]
instance_eval &the_proc
response.finish
end
end
at_exit do
Rack::Handler.default.run HTTP.new
end
Our next step is creating some way to add methods to that @@routes hash. For that we will create a class method called save_route. We’ll also add some other methods to the hash as well and make sure that if there is no block found for a url that we send back a 404:
require 'rack'
class HTTP
attr_accessor :response, :request
@@routes = { get: {}, put: {}, post: {}, delete: {}, patch: {}, head: {} }
def self.save_route *args
method, route, block = *args
@@routes[method.downcase.to_sym][route] = block
end
def call env
puts "Handling request for: #{env["PATH_INFO"]}"
@request = Rack::Request.new env
@response = Rack::Response.new
block = @@routes[request.request_method.downcase.to_sym][request.path_info]
# if no block is stored for that path; 404!
block ? instance_eval(&block) : throw_404
response.finish
end
private
def throw_404
@response.status = 404
@response.write "<html>Page Not Found</html>"
end
end
at_exit do
Rack::Handler.default.run HTTP.new
end
Now that we can add routes to our class, we need to turn our attention to adding methods to the main object. The methods we want to add are the usual HTTP methods, get, put and whatnot.
We want to define an method for each of them like this:
def get *args, &block HTTP.save_route(:get, args.first, block) end
But since that is kind of repetitive we are going to write some code that writes that code. Often you would use Module#define_method for this but the main object is weird and does not have that method. So I am going to use eval:
require 'rack'
class HTTP
#... all the HTTP code ...
end
def http_methods
%w(get put post delete head patch).each do |method_name|
eval <<-EOMETH
def #{method_name} *args, &block
HTTP.save_route(:#{method_name}, args.first, block)
end
EOMETH
end
end
at_exit do
# ... rack stuff ...
end
Then we need to open the eigenclass of main and attach the methods to that. This is so the methods are available as instance methods of the main object. We can do that with Ruby’s somewhat bizarre syntax:
require 'rack' class HTTP #... all the HTTP code ... end def http_methods #... all the HTTP code ... end class << self http_methods end at_exit do # ... rack stuff ... end
With that we now have a working toy version of Sinatra. We can use it like this:
require_relative 'http' get "/" do response.status = 200 response["HTTP-Referrer"] = "Mike" response.write "<html>Hello Whirled</html>" end
When you are working in Rails you often hear about Rack but its not usually something you interact directly with. Playing with this has really made me appreciate Sinatra for the intelligent, concise DSL that it is (which is easy to forget somehow). While playing with DSLs is fun, taking some time to get to know Rack has also really helped my understanding of Rails.
- In: Geeky
- Leave a Comment
Launched in October 2012, the Cover Art Archive is a joint project between two non-profits; Musicbrainz and the Internet Archive (legally recognized as a library in California). It aims to create a definitive dataset of CD cover art in the public domain. Cover art exists in somewhat contested legal territory. Its copyrighted artwork, but also part of a products visual identity. Some uses are considered “fair use” and legally OK, other uses result in legal action while the majority, it seems, is just ignored/tolerated. Advice on usage seems to boil down to “its OK to use it until its not”.
Fortunately the Internet Archive is willing to hold that legal hot potato and host the images since this fits with libraries mission to “preserve society’s cultural artifacts and to provide access to them” which they are extending into the digital world. Since cover art is such a big part of the identity of a CD, a reliable source for cover art is a big thing for developers of audio applications and to organizations such as libraries who typically have large catalogues of CDs. Displaying cover art is an important part of the user interface of many applications such as Banshee.
While explaining the need for the project, Musicbrainz politely noted that developers needing cover art “can use Amazon product images, but your project needs to be able to abide by their Terms of Service, which doesn’t work for everyone.”
This diplomatic phrasing really undercuts the importance of their project. The problem they are tackling is evident in the first line of the Enrollment section of Amazon’s Terms of service:
Unsuitable applications include those that:
(a) do not have as their principal purpose advertising and marketing the Amazon Site and driving sales of products and services on the Amazon Site;
Apple’s iTunes API has a similar restriction. The difficulty here should be obvious if you are familiar with Lawrence Lessig’s famous Free Culture talk. The refrain he repeats throughout his talk is this:
<refrain>
1. Creativity and innovation always builds on the past.
2. The past always tries to control the creativity that builds on it.
3. Free societies enable the future by limiting the past.
4. Ours is a less and less free society.
</refrain>
Amazon’s product database contains a huge number of cultural artefacts representing a large chunk of our collective past. The restrictions placed on access to that dataset are attempts to control how those in the present build on that past. Whatever you are building, be it a library, or something that acts like one or anything else, the condition for building on this slice of the past is that it must have as its principal purpose driving sales to Amazon. While still in its infancy (there are covers for only 8% of the albums in Musicbrainz), the Cover Art Archive’s aim of providing data without such restrictions is certainly a worthy of support.
So what does support look like? Adding cover art to the archive is done through the Musicbrainz interface. Pick a CD off your shelf and see if Musicbrainz has the artwork for it. Often when you click the “Cover Art” tab you see something like the following:

If you do, scan the CD cover and upload a JPG image to Musicbrainz. Detailed instructions can be found on their site. They will pass it on to the Cover Art Archive. The covers you added will then be available to any developer using the libcoverart library or the Musicbrainz web API in their programs.
Hopefully this project will give developers the unrestricted datasource they need to explore their ideas without feeling compelled to shoehorn in an Amazon/iTunes sales channel… but it will be your contributions that make it possible.
Contributing to Musicbrainz
Posted on: January 31, 2013
- In: linux | ubuntu
- Leave a Comment
Hacking on code is not the only way to contribute to the Free Software / Open Source Software community. Many applications rely on external datasets to provide some or most of their functionality and a contribution there helps all the projects downstream.
Ubuntu’s default music application Rhythmbox as well as Banshee, KDE’s Amarok and a host of smaller programs like Sound Juicer all offer the ability to rip CDs. For this feature to be seen to “work” in the eyes of the user the software needs to correctly identify the CD and add the appropriate album details and track names. To do this, these programs all query the Musicbrainz database and the quality of that response essentially decides the users experience of the ripping process; Will it be a one click “import”, or 10 minutes of filling in track names while squinting at the CD jacket? God help you if you have tracks with accented characters and an English keyboard.
What all this means is that every contribution to Musicbrainz results in a better experience for users of ALL of these programs. When someone somewhere decides to rip their favourite obscure CD, and the software magically fills in the track names and album details, its a pretty happy moment. So if you have wanted to contribute to the Free/Open Source Software community but don’t have the programming chops to do it, contributing to Musicbrainz is one way to help out.
The Musicbrainz dataset is under the Creative Commons CCO license which places all the data in the public domain. This means that your contributions will stay open to the public and we won’t have another CDDB/Gracenote situation where people contributed to a database that ended up charging for access. All you need to get started is to create a Musicbrainz account.
A typical contribution looks something like this. I’ll decide to rip one of my CDs and pop it in the drive. I launch Rhythmbox which will tell me if its not recognized:
When you click the “Submit Album” button the application will send you to the Musicbrainz website with the Table Of Contents (TOC) information from the CD in the url. Once on the site you will need to search for the Artist or Release to add the TOC to:
Most of the time there will be an entry in the database for the Artist and all that needs to happen is to add the TOC that you are still carrying from page to page in the url to one of the Artists CDs. In cases where the search returns multiple matches I usually explore the different options by ctrl+clicking on the results to open them in separate tabs.
Click through the artists albums until you find the one you are looking for, or add one if you need to. In this case there was one already there (and all the details including the catalog number matched) so my next step was to click the “Attach CD TOC”. This takes the TOC you can see in the address bar and attaches it to that release.
You will be asked to add a note describing where this information you are providing is coming from. In this case its coming from the CD. Add the note and you are done. What make contributing to Musicbrainz particularly gratifying is that next time you put in the CD, it is recognized right away. My favourite kind of gratification: instant. You can also immediately see the results in Rhythmbox, as well as Banshee and any other application that uses Musicbrainz.
Its pretty great thinking that the few minutes invested in this process not only solves your immediate problem of having an unrecognised CD, but also makes software all over the Linux ecosystem just a tiny bit better. That’s a win/win situation if I’ve ever seen one.







