Skip to navigation.


Rails in a Nutshell

Posted October 20, 2009 —

For the past while I’ve been working on a book called Rails in a Nutshell with three other great fellows: Cody, Edward, and John. With this book, we want to provide the best possible reference for anyone working with Rails 3.0.

I want you to be able to flip through the index or ctrl/⌘-F through the PDF and quickly find the satisfying and practical explanation you need. We are favouring “cutting to the chase” over describing everything that Rails has to offer. There will be some lists and charts here and there, but we would rather spend time on practical advice for common situations than on enumerating every element of the API.

With the help of O’Reilly, we’re able to make the book available online before publication for you to interact with as it is written. We’re making it really easy for you to provide feedback on any part of the book as it evolves, using an O’Reilly system called OFPS.

The book has a twitter account in addition to the live manuscript, and the authors are here:

Cody Fauser

Edward Ocampo-Gooding

John Guenin

Me

Address already in use

Posted September 16, 2009 —

If you get this:

Address already in use - bind(2) (Errno::EADDRINUSE)

…do this:

$ lsof -i :3000
COMMAND  PID  USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
ruby    9736 james    7u  IPv4 0x084b4a8c      0t0  TCP *:hbci (LISTEN)
$ kill 9736

(or, with your actual port number instead of 3000)

Comments on Copyright

Posted September 13, 2009 —

Better late than never. I just fired this email off to the feds on the last day of the Canadian public copyright consultation. It is structured to answer the five questions provided as a basis for responses.

How copyright laws affect me

My name is James MacAulay, and I am a Canadian living in Ottawa. I earn my living building software, mainly software which runs on the web. Some of this is kept proprietary for either myself or my employer. Some is offered up for anyone to use, learn from, and build upon, by releasing it under an open source license to the public. In my industry, the best way to build a career and gain recognition is to release much of what you produce in this way.

Likewise, all the software I produce is built almost entirely using existing software which other people have released as open source. I am not an exceptional case here; the whole industry of web development in Canada and the world would essentially grind to a halt without open source.

Canadians currently enjoy a thriving ecosystem of individual entrepreneurs and small businesses building software for the web, and this is precisely because of the competitive advantage gained by people limiting the full effects of copyright on their own work.

How copyright laws should be changed…

…to be modernized and to withstand the test of time

It is currently easier than ever before to copy information of all kinds. The Internet is becoming ever more prevalent in all of our lives, and the Internet is, among other things, a huge copying machine which becomes more efficient at this task each day. Copyrighted data is duplicated and cached and re-duplicated over and over again, with and without our knowledge, every time we browse the web, and this is an essential aspect of what makes the web work as well as it does.

Any changes to Canada’s copyright law should take into account these important facts:

  • no matter what the law says, copyrighted works are going to be copied with or without the author’s consent on a vast scale.
  • as difficult as it is to keep information from being copied today, it will get more and more difficult in the future.

What does this mean for a realistic and forward-thinking body of copyright laws? For one thing, enshrining “Technical Protection Measures” (TPMs)—a.k.a. “Digital Rights Management” (DRM)—in law by making the circumvention of these technologies a crime is just insane. At best, TPMs are misguided attempts to protect business models which are on their way to a slow death anyway. At worst, they are anti-competitive practices meant to prevent a product’s users from doing anything with that product that the vendor did not intend. Either way, they don’t actually work. This is evident in how quickly each new TPM is broken by those who wish to circumvent it.

If I purchase a shovel, I expect that I should be able to replace the wooden shaft with a more ergonomic one if I so desire. Perhaps that ergonomic handle comes from different shovel-maker than the original, and perhaps the original shovel-maker intentionally made it difficult for me to replace the shaft with one of its competitors. All the same, the law should not prevent me from switching shafts.

Similarly, if I purchase an electronic device which plays games stored on individual discs or cartridges, I expect that I should be able to modify that device so that my games can be more conveniently stored in a single place. I also expect that I should be able to modify my device to play different sorts of games than the ones intended by the vendor. Yet this is exactly the sort of behaviour which is outlawed by anti-circumvention laws in the United States, and it has been a disaster.

Anti-circumvention laws are unnecessary and damaging. If someone is circumventing TPMs in order to violate copyright, then we already have a law to deal with that: copyright law. Anti-circumvention laws only serve to unnecessarily limit the freedom of individuals to do what they want with the things that they have paid for.

…to best foster innovation and creativity in Canada

The amount of time that a work is held under copyright has increased drastically over the years. The Statute of Anne in 1710 provided a maximum limit of two 14-year terms starting at the date of publication (and of course, before then, everything was in the public domain). Here in Canada, the limit for most works is now 50 years after the death of the author.

Why is it so long? Copyright law’s primary purpose is to encourage people to create, and everything that we create is based upon the works of others. There is a huge difference between the limits in 1710 and the limits now, yet is there anyone today who would decide not to create something of value simply because their copyright instead only lasted 28 years? The pace of change in technology and cultural exchange is only accelerating, yet for some reason we are locking up the culture that we create for longer and longer periods of time.

The ability to freely use others’ works is an incredibly important freedom to protect, and by putting such long limits on copyright terms we are injuring every Canadian’s potential to learn and create. These long limits also make it incredibly difficult for older works to be restored and made available to new audiences. We are losing access to our cultural heritage because of a law which is meant to enrich it.

There are, of course, international agreements which would make it difficult for us to scale back these term limits right now. But we can decide to put an end to any further term extensions, and we should.

…to best foster competition and investment in Canada, and to best position Canada as a leader in the global, digital economy

No matter what laws we make, business models in many industries will have to radically change to accommodate—and take advantage of—the prevalence of cheap copying of information. We are seeing it now in the music industry: both established superstars and eager newcomers are either thriving or disappearing based on their ability to exploit the new and changing landscape of global communications. The big record labels are heavily invested in the way that they’ve always done things, and they are suffering for it.

How to respond? Well, the last thing we want to do is make laws to save old business models which won’t survive anyway. If we go down that road, then we make Canadian businesses less competitive by propping up the ones that aren’t taking advantage of new opportunities. No one knows what the best business models are going to be in the coming decades for musicians, artists, actors, writers, or anyone else who creates intellectual works of value. What we do know is that the successful ones aren’t going to arise any faster by supporting the ones from the past.

We need to limit the extremes of modern copyright law by putting the focus back on encouraging artistic expression and, more generally, the creation of value for society as a whole. This is the core value which should guide the evolution of copyright law, and any other considerations should be purged from the discussion. The biggest problem for the vast majority of creators is not an excess of unauthorized copying; it is not enough unauthorized copying. The problem for most is that they need exposure to a wider audience.

Our laws should not put undue emphasis on punishing the copying that individuals do for non-commercial purposes. Instead of thinking that we can stop unauthorized copying simply by criminalizing it, we should focus our efforts on finding innovative new ways to compensate artists; ways which embrace the sharing of information instead of being allergic to it.

Conclusion

The way to make a set of copyright laws for the future is through a return to copyright’s original purpose. Copyright infringement is not the same as theft, “intellectual property” is not really property at all, a person does not own the music or software or stories that they produce in the same way that they own a bicycle. We choose to uphold copyright law because we want to encourage and reward innovation and creative expression. This is the primary goal, and we can do a lot of damage to our culture if we act as though copyright had any other purpose.

Got 8 minutes? Put a Shopify app online!

Posted June 11, 2009 —

Here’s how:

You could probably shave a minute off the process by using this rails template to generate your app:

rails my_shopify_app -m http://github.com/jamesmacaulay/rails-templates/raw/master/shopify_app.rb

Three Worlds Collide

Posted February 02, 2009 —

Over at Overcoming Bias, the Bayesian sensation Eliezer Yudkowsky is syndicating a wonderful SF tale he wrote called Three Worlds Collide. Here’s a snippet from part one, describing just the tip of the iceberg of how alien an alien system of ethics could be:

“And anyone who tried to cheat, to hide away a child, or even go easier on their own children during the winnowing – well, the Babyeaters treated the merciful parents the same way that human tribes treat their traitors.

“They developed psychological adaptations for enforcing that, their first great group norm. And those psychological adaptations, those emotions, were reused over the course of their evolution, as the Babyeaters began to adapt to their more complex societies. Honor, friendship, the good of our tribe – the Babyeaters acquired many of the same moral adaptations as humans, but their brains reused the emotional circuitry of infanticide to do it.

“The Babyeater word for good means, literally, to eat children.”

It just gets better from there. He’s halfway through releasing the eight-part story, and I am thoroughly engrossed.