<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Labs &#187; development</title>
	<atom:link href="http://labs.creativecommons.org/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.creativecommons.org</link>
	<description>by Creative Commons</description>
	<lastBuildDate>Thu, 18 Mar 2010 16:17:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using virtualenv and zc.buildout together</title>
		<link>http://labs.creativecommons.org/2010/03/16/using-virtualenv-and-zc-buildout-together/</link>
		<comments>http://labs.creativecommons.org/2010/03/16/using-virtualenv-and-zc-buildout-together/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 15:47:41 +0000</pubDate>
		<dc:creator>cwebber</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[techblog]]></category>
		<category><![CDATA[buildout]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=462</guid>
		<description><![CDATA[Virtualenv and zc.buildout are both great ways to develop python packages and deploy collections of packages without needing to touch the system library.  They are both fairly similar, but also fairly different.
The primary difference between them is that zc.buildout focuses on having a single package, and all relevant dependencies are installed automatically within that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pypi.python.org/pypi/virtualenv">Virtualenv</a> and <a href="http://www.buildout.org/">zc.buildout</a> are both great ways to develop python packages and deploy collections of packages without needing to touch the system library.  They are both fairly similar, but also fairly different.</p>
<p>The primary difference between them is that zc.buildout focuses on having a single package, and all relevant dependencies are installed automatically within that package&#8217;s directory via the buildout script (Nathan Yergler points out that you don&#8217;t have to use things this way, but that seems to me to be the way things happen in practice&#8230; anyway, I&#8217;m not a buildout expert).  The buildout script is very automagical and does all the configuration and installation of dependencies for you.   Since this is a build system, you can also configure it to do a number of other neat things, such as compile all your gettext catalogs, or scp the latest cheesefile.txt from themoon.example.org&#8230; whatever you need to do to build a package.</p>
<p>Virtualenv is mostly the same creature, but it&#8217;s like you reached your hand inside and pulled it inside out.  Instead of a bunch  of packages installed within a subdirectory of one package, there is a more generic directory layout that allows you to set up a number of packages within it.  Installing a package and keeping it up to date is much more manual in general, but also a bit more flexible in the sense that you can switch paths around within the environment fairly easily and simultaneously developing multiple interwoven packages is not difficult.</p>
<p>I came to CC with a lot of experience with virtualenv and no experience with zc.buildout.  Initially I could discern no differences of use case between them, but now I have a pretty good sense of when you&#8217;d want to use one over the other.  An example use case, which has come up pretty often with me actually: say you have two packages, one of which is a dependency on the other.  In this case, we&#8217;ll use both cc.license and cc.engine, where cc.engine has cc.license as a<br />
dependency.</p>
<p>Now say I&#8217;m adding a feature to cc.engine, but this feature also requires that I add something in cc.license.  At this point it is<br />
easier for me to switch to using virtualenv; I can set up both development packages in the same virtualenv and use them together.  This is great because it means that I should have little to no difficulty switching back and forth between both of them.  If I make a change in cc.license it is immediately available to me in cc.engine.  This also  prevents either having to set up a tedious to switch around configuration checking out cc.license into cc.engine and etc, or making a bunch of unnecessary releases just to make sure things work, etc.  It&#8217;s easier to work on multiple packages at once in<br />
virtualenv in my experience.</p>
<p>Now let&#8217;s assume that we got things in working order, cc.license has the new feature and cc.engine is able to use it properly, tests are passing, and et cetera.  At this point is where I think returning to zc.buildout is a good idea.  One of the things I like about zc.buildout is that it provides a certain type of integrity checking with the buildout command.  If you forget to mark a dependency or even remove it from setup.py on accident or whatever, buildout will simply unlink it from your path the next time you run it.  In this case, I think zc.buildout is especially useful because I might forget to make a cc.license release here or some such thing.  There are some other reasons for using zc.buildout (as the name implies, buildout is a full build system, so there are a lot of neat things you can do with it), but for a forgetful person such as myself this is by far the most important to me (and the most relevant to this example).</p>
<p>So I&#8217;ve described use cases for both cc.engine and cc.license.  How do we get them to work nicely together?  Let&#8217;s assume we just want to check out these packages once.  Let&#8217;s also assume that our virtualenv directory is ~/env/ccommons (because I&#8217;m clearly basing this off my own current setup currently, heh).</p>
<p>First, we&#8217;ll create our virtualenv environment, if we haven&#8217;t already:</p>
<blockquote>
<pre>$ virtualenv ~/env/ccommons
</pre>
</blockquote>
<p>Next, we&#8217;ll check out cc.engine and cc.license into ~/devel/ and run<br />
buildout on each:</p>
<blockquote>
<pre>$ cd ~/devel/
$ git clone git://code.creativecommons.org/cc.license.git
$ git clone git://code.creativecommons.org/cc.engine.git
</pre>
</blockquote>
<p>Next, we&#8217;ll buildout the packages:</p>
<blockquote>
<pre>$ cd ~/devel/cc.license
$ wget http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py
$ python bootstrap.py
$ ./bin/buildout
$ cd ~/devel/cc.engine
$ python bootstrap.py # the cc engine already has bootstrap.py checked in
$ ./bin/buildout
</pre>
</blockquote>
<p>Buildout can take a while, so be prepared to go grab some cookies and coffee and/or tea.  But once it&#8217;s done, getting these packages set up in virtualenv is super simple.</p>
<p>First activate the virtualenv environment:</p>
<blockquote>
<pre>$ source ~/env/ccommons/bin/activate
$ cd ~/devel/cc.license
$ python setup.py develop
$ cd ~/devel/cc.engine
$ python setup.py develop
</pre>
</blockquote>
<p>That&#8217;s it!  Now we can verify that these packages are set up in virtualenv.  Open python and verify that you get the following output (adjusted to your own home directory and etc):</p>
<blockquote>
<pre>&gt;&gt;&gt; import cc.engine
&gt;&gt;&gt; cc.engine.__file__
'/home/cwebber/devel/cc.engine/cc/engine/__init__.pyc'
&gt;&gt;&gt; import cc.license
&gt;&gt;&gt; cc.license.__file__
'/home/cwebber/devel/cc.license-git/cc/license/__init__.pyc'
</pre>
</blockquote>
<p>To leave virtualenv, you can simply type &#8220;deactivate&#8221;.</p>
<p>That&#8217;s it!  Now you have a fully functional zc.buildout AND virtualenv setup, where switching back and forth is super simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2010/03/16/using-virtualenv-and-zc-buildout-together/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>cc.engine and web non-frameworks</title>
		<link>http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/</link>
		<comments>http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 22:04:43 +0000</pubDate>
		<dc:creator>cwebber</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[sanity]]></category>
		<category><![CDATA[cc.engine]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[wsgi]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=432</guid>
		<description><![CDATA[The sanity overhaul has included a number of reworkings, one of them being a rewrite of cc.engine, which in its previous form was a Zope 3 application.  Zope is a full featured framework and we already knew we weren&#8217;t using many of its features (most notably the ZODB); we suspected that something simpler would [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://labs.creativecommons.org/2009/12/18/understanding-the-state-of-sanity-via-whiteboards-and-ascii-art/">sanity overhaul</a> has included a number of reworkings, one of them being a rewrite of cc.engine, which in its previous form was a Zope 3 application.  Zope is a full featured framework and we already knew we weren&#8217;t using many of its features (most notably the ZODB); we suspected that something simpler would serve us better, but weren&#8217;t certain what.  Nathan suggested one of two directions: either we go with Django (although it wasn&#8217;t clear this was &#8220;simpler&#8221;, it did seem to be where a large portion of the python knowledge and effort in the web world is pooling), or we go with <a href="http://docs.repoze.org/bfg/">repoze.bfg</a>, a minimalist WSGI framework that pulls in some Zope components.  After some discussion we both agreed: repoze.bfg seemed like the better choice for a couple of reasons: for one, Django seemed like it would be providing quite a bit more than necessary&#8230; in cc.engine we don&#8217;t have a traditional database (we do have an RDF store that we query, but no SQL), we don&#8217;t have a need for a user model, etc&#8230; the application is simple: show some pages and apply some specialized logic.  Second, repoze.bfg built upon and reworked Zope infrastructure and paradigms, and so in that sense it looked like an easier transition.  So we went forward with that.</p>
<p>As I went on developing it, I started to feel more and more like, while repoze.bfg certainly had some good ideas, I was having to create a lot of workarounds to support what I needed.  For one thing, the URL routing is unordered and based off a ZCML config file.  It was at the point where, for resolving the license views, I had to route to a view method that then called other view methods.  We also needed a type of functionality as Django provides with its &#8220;APPEND_SLASH=True&#8221; feature.  I discussed with the repoze.bfg people, and they were accommodating to this idea and actually applied it to their codebase for the next release.  There were some other components they provided that were well developed but were not what we really needed (and were besides technically decoupled from repoze.bfg the core framework).  As an example, the <a href="http://chameleon.repoze.org/">chameleon zpt</a> engine is very good, but it was easier to just pull Zope&#8217;s template functionality into our system than make the minor conversions necessary to go with chameleon&#8217;s zpt.</p>
<p>Repoze was also affecting the Zope queryutility functionality in a way that made internationalization difficult.  Once again, this was done for reasons that make sense and are good within a certain context, but make did not seem to mesh well with our existing needs.  I was looking for a solution and reading over the repoze.bfg documentation when I came across these lines:</p>
<blockquote><p>repoze.bfg provides only the very basics: URL to code mapping, templating, security, and resources. There is not much more to the framework than these pieces: you are expected to provide the rest.</p></blockquote>
<p>But if we weren&#8217;t using the templating, we weren&#8217;t using the security model, and we weren&#8217;t using the resources, the URL mapping was making things difficult, and those were the things that repoze.bfg was providing on top of what was otherwise just WSGI + WebOb, how hard would it be to just strip things down to just the WSGI + WebOb layer?  It turns out, not too difficult, and with an end result of significantly cleaner code.</p>
<p>I went through Ian Bicking&#8217;s excellent tutorial <a href="http://pythonpaste.org/webob/do-it-yourself.html">Another Do-It-Yourself Framework</a> and applied those ideas to what we already had in cc.engine.  Within a night I had the entire framework replaced with a single module, cc/engine/app.py, which contained these few lines:</p>
<pre>import sys
import urllib

from webob import Request, exc

from cc.engine import routing

def load_controller(string):
    module_name, func_name = string.split(':', 1)
    __import__(module_name)
    module = sys.modules[module_name]
    func = getattr(module, func_name)
    return func

def ccengine_app(environ, start_response):
    """
    Really basic wsgi app using routes and WebOb.
    """
    request = Request(environ)
    path_info = request.path_info
    route_match = routing.mapping.match(path_info)
    if route_match is None:
        if not path_info.endswith('/') \
                and request.method == 'GET' \
                and routing.mapping.match(path_info + '/'):
            new_path_info = path_info + '/'
            if request.GET:
                new_path_info = '%s?%s' % (
                    new_path_info, urllib.urlencode(request.GET))
            redirect = exc.HTTPTemporaryRedirect(location=new_path_info)
            return request.get_response(redirect)(environ, start_response)
        return exc.HTTPNotFound()(environ, start_response)
    controller = load_controller(route_match['controller'])
    request.start_response = start_response
    request.matchdict = route_match
    return controller(request)(environ, start_response)

def ccengine_app_factory(global_config, **kw):
    return ccengine_app</pre>
<p>The main method of importance in this module is ccengine_app.  This is a really simple WSGI application: it takes routes as defined in cc.engine.routes (which uses the very enjoyable <a href="http://routes.groovie.org/">Routes</a> package) and sees if the current URL (or, the path_info portion of it) matches that URL.  If it finds a result, it loads that controller and passes a WebOb-wrapped request into it, with any special URL matching data tacked into the matchdict attribute.  And actually, the only reason that this method is even so long at all is because of the &#8220;if route_match is None&#8221; block in the middle: that whole part is providing APPEND_SLASH=True type functionality, as one would find in Django.  (Ie, if you&#8217;re visiting the url &#8220;/licenses&#8221;, and that doesn&#8217;t resolve to anything, but the URL &#8220;/licenses/&#8221; does, redirect to /licenses/.)  The portions before and after are just getting the controller for a url and passing the request into it.  That&#8217;s all! (The current app.py is a few lines longer than this, utilizing a callable class rather than a method in place of ccengine_app for the sake of configurability and attaching a few more things onto the request object, but not longer or complicated by much.  The functionality otherwise is pretty much the same.)</p>
<p>Most interesting is that I swapped in this code, changed over the routing, fired up the server and.. it pretty much just worked.  I swapped out a framework for about a 50 line module and everything was just as nice and functioning as it was.  In fact, with the improved routing provided by Routes, I was able to cut out the fake routing view, and thus the amount of code was actually *less* than what it was before I stripped out the framework.  Structurally there was no real loss either; the application still looks familiar to that you&#8217;d see in a pylons/django/whatever application.</p>
<p>I&#8217;m still a fan of frameworks, and I think we are very fortunate to *have* Zope, Pylons, Django, Repoze.bfg, and et cetera.  But in the case of cc.engine I do believe that the position we are at is the right one for us; our needs are both minimal and special case, and the number of components out there for python are quite rich and easily tied together.  So it seems the best framework for cc.engine turned out to be no framework at all, and in the end I am quite happy with it.</p>
<p><strong>ADDENDUM:</strong> Chris McDonough&#8217;s comments below are worth reading.  It&#8217;s quite possible that the issues I experienced were my own error, and not repoze.bfg&#8217;s.  I also hope that in no way did I give the impression that we moved away from repoze.bfg because it was a bad framework, because repoze.bfg is a great framework, especially if you are using a lot of zope components and concepts.  It&#8217;s also worth mentioning that the type of setup that we ended up at, as I described, probably wouldn&#8217;t have happened unless I had adapted my concepts directly from repoze.bfg, which does a great job of showing just how usable Zope components are without using the entirety of Zope itself.  Few ideas are born without prior influence; repoze.bfg was built on ideas of Zope (as many Python web frameworks are in some capacity), and so too was the non-framework setup I described here based on the ideas of repoze.bfg.  It is best for us to be courteous to giants as we step on their shoulders, but it is also easier to forget or unintentionally fail to extend that courtesy as I may have done here.  Thankfully I&#8217;ve talked to Chris offline and he didn&#8217;t seem to have taken this as an offense, so for that I am glad.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MediaWiki, the application platform</title>
		<link>http://labs.creativecommons.org/2010/01/08/mediawiki-the-application-platform/</link>
		<comments>http://labs.creativecommons.org/2010/01/08/mediawiki-the-application-platform/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 23:41:22 +0000</pubDate>
		<dc:creator>Nathan Yergler</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[mediawiki]]></category>
		<category><![CDATA[semantic mediawiki]]></category>
		<category><![CDATA[smw]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=406</guid>
		<description><![CDATA[As noted on the CC weblog and elsewhere, AcaWiki launched back in October.  I&#8217;m much later noting the launch, which is really inexcusable since CC did much of the tech buildout.  AcaWiki is only the most recent example of our work with Mediawiki and Semantic Mediawiki.  Both are critical pieces of our [...]]]></description>
			<content:encoded><![CDATA[<p>As noted on the <a href="http://creativecommons.org/weblog/entry/18234">CC weblog</a> and <a href="http://gondwanaland.com/mlog/2009/10/06/acawiki/">elsewhere</a>, AcaWiki <a href="http://acawiki.org/AcaWiki:PressRelease-2009-10-07">launched</a> back in October.  I&#8217;m <a href="http://yergler.net/blog/2010/01/04/acawiki-on-building-emerging-applications/">much later noting the launch</a>, which is really inexcusable since CC did much of the tech buildout.  AcaWiki is only the most recent example of our work with <a href="http://mediawiki.org">Mediawiki</a> and <a href="http://semantic-mediawiki.org">Semantic Mediawiki</a>.  Both are critical pieces of our infrastructure here, and tools we&#8217;d like to see developed further.  One area that we&#8217;ve brainstormed but not attempted to implement is the idea of &#8220;actions&#8221;; you can read an overview of the idea <a href="http://yergler.net/blog/2010/01/07/actions-for-smw-applications-hypothetically/">here</a>.</p>
<p>The combination of Mediawiki and Semantic MediaWiki has allowed us to build applications faster and increase the effective number of &#8220;developers&#8221; on our team by lowering the barriers to entry.  I expect 2010 to be a really interesting year for wiki applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2010/01/08/mediawiki-the-application-platform/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Caching deeds for peak performance</title>
		<link>http://labs.creativecommons.org/2010/01/06/caching-deeds-for-peak-performance/</link>
		<comments>http://labs.creativecommons.org/2010/01/06/caching-deeds-for-peak-performance/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 20:10:31 +0000</pubDate>
		<dc:creator>Nathan Yergler</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[cc.engine]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[wsgi]]></category>
		<category><![CDATA[wsgi_cache]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=401</guid>
		<description><![CDATA[As Chris mentioned, he&#8217;s been working on improving the license chooser, among other things simplifying it and making it a better behaved WSGI citizen.  That code also handles generating the license deeds.  For performance reasons we like to serve those from static files; I put together some details about wsgi_cache, a piece of [...]]]></description>
			<content:encoded><![CDATA[<p>As Chris <a href="http://labs.creativecommons.org/2009/12/18/understanding-the-state-of-sanity-via-whiteboards-and-ascii-art/">mentioned</a>, he&#8217;s been working on improving the <a href="http://creativecommons.org/choose/">license chooser</a>, among other things simplifying it and making it a better behaved <a href="http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface">WSGI</a> citizen.  That code also handles generating the license deeds.  For performance reasons we like to serve those from static files; I <a href="http://yergler.net/blog/2010/01/05/caching-wsgi-applications-to-disk/">put together some details</a> about <a href="http://pypi.python.org/pypi/wsgi_cache">wsgi_cache</a>, a piece of WSGI middleware I wrote this week to help with this, on my <a href="http://yergler.net/blog/">personal blog</a>:</p>
<blockquote><p>The idea behind wsgi_cache is that you create a disk cache for results, caching only the body of the response. We only cache the body for a simple reason—we want something else, something faster, like Apache or other web server, to serve the request when it’s a cache hit. We’ll use mod_rewrite to send the request to our WSGI application when the requested file doesn’t exist; otherwise it hits the on disk version. And cache “invalidation” becomes as simple as rm (and as fine grained as single resources).</p></blockquote>
<p>You can read the full entry <a href="http://yergler.net/blog/2010/01/05/caching-wsgi-applications-to-disk/">here</a>, find wsgi_cache <a href="http://pypi.python.org/pypi/wsgi_cache">documentation on PyPI</a>, and get the <a href="http://code.creativecommons.org/viewgit/wsgi_cache.git/">source code</a> from our git repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2010/01/06/caching-deeds-for-peak-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding the State of Sanity (via whiteboards and ascii art)</title>
		<link>http://labs.creativecommons.org/2009/12/18/understanding-the-state-of-sanity-via-whiteboards-and-ascii-art/</link>
		<comments>http://labs.creativecommons.org/2009/12/18/understanding-the-state-of-sanity-via-whiteboards-and-ascii-art/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 20:14:19 +0000</pubDate>
		<dc:creator>cwebber</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[license engine]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ascii art]]></category>
		<category><![CDATA[cc.engine]]></category>
		<category><![CDATA[cc.license]]></category>
		<category><![CDATA[sanity]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=387</guid>
		<description><![CDATA[Since I started working at Creative Commons a number of months ago, I&#8217;ve been primarily focused on something we refer to as the &#8220;sanity overhaul&#8221;.  In this case, sanity refers to try and simplify what is kind of a long and complicated code history surrounding Creative Commons&#8217; licenses, both as in terms of the internal [...]]]></description>
			<content:encoded><![CDATA[<p>Since I started working at Creative Commons a number of months ago, I&#8217;ve been primarily focused on something we refer to as the &#8220;sanity overhaul&#8221;.  In this case, sanity refers to try and simplify what is kind of a long and complicated code history surrounding Creative Commons&#8217; licenses, both as in terms of the internal tooling to modifying, deploying, and querying licenses and the public facing web interfaces for viewing and downloading them.  Efforts toward the sanity overhaul started before I began working here, executed by both Nathan Yergler and Frank Tobia, but for a long time they were in a kind of state of limbo as other technical efforts had to be dedicated to other important tasks.  The good news is that my efforts have been permitted to be (almost) entirely dedicated toward the sanity overhaul since I have started, and we are reaching a point where all of those pieces are falling into place and we are very close to launch.</p>
<p>To give an idea of the complexity of things as they were and how much that complexity has been reduced, it is useful to look at some diagrams.  When Nathan Kinkade first started working at Creative Commons (well before I did), Nathan Yergler took some time to draw on the whiteboard what the present infrastructure looked like:</p>
<p><a href="http://www.flickr.com/photos/nathan_y/2347987536/sizes/m/in/photostream/"><img class="alignnone" title="The Present" src="http://farm3.static.flickr.com/2297/2347987536_5515b1f963.jpg" alt="" width="500" height="375" /></a></p>
<p>as well as what he envisioned the &#8220;glorious future&#8221; (sanity) would look like:</p>
<p><a href="http://www.flickr.com/photos/nathan_y/2347986388/sizes/m/in/photostream/"><img class="alignnone" title="The Glorious Future (Sanity)" src="http://farm4.static.flickr.com/3267/2347986388_dd1c466a5e.jpg" alt="" width="500" height="375" /></a></p>
<p>When I started, the present infrastructure had shifted a little bit further still, but the vision of the &#8220;glorious future&#8221; (sanity) had mostly stayed the same.</p>
<p>This week (our &#8220;tech all-hands week&#8221;) I gave a presentation on the &#8220;State of Sanity&#8221;.  Preparing for that presentation I decided to make a new diagram.  Since I was already typing up notes for the presentation in Emacs, I thought I might try and make the most minimalist and clear ASCII art UML-like diagram that I could (my love of ASCII art is well known to anyone who hangs out regularly in #cc on Freenode).  I figured that I would later convert said diagram to a traditional image using <a href="http://inkscape.org">Inkscape</a> or <a href="http://projects.gnome.org/dia/">Dia</a>, but I was so pleased with the end result that I just ended up using the ASCII version:</p>
<pre>*******************
* CORE COMPONENTS *
*******************

      .--.
     ( o_o)
     /'---\
     |USER| --.
     '----'   |
              |
              V
         ___   .---.
       .'   ','     '.
     -'               '.
    (     INTARWEBS     )
     '_.     ____    ._'
        '-_-'    '--'
              |
              |
              V
      +---------------+  Web interface user
      |   cc.engine   |  interacts with
      +---------------+
              |
              |
              V
      +---------------+  Abstraction layer for
      |  cc.license   |  license querying and
      +---------------+  pythonic license API
              |
              |
              V
      +---------------+  Actual rdf datastore and
      |  license.rdf  |  license RDF operation tools
      +---------------+  

****************
* OTHER PIECES *
****************

  +--------------+
  |  cc.i18npkg  |
  | .----------. |
  | | i18n.git | |
  +--------------+

********************************************
* COMPONENTS DEPRECATED BY SANITY OVERHAUL *
********************************************

  +------------+  +-----------+  +---------+  +-------------+
  |    old     |  | old zope  |  | licenze |  | license_xsl |
  | cc.license |  | cc.engine |  +---------+  +-------------+
  +------------+  +-----------+</pre>
<p>This isn&#8217;t completely descriptive on its own, and I will be annotating as I include it in part of the <a href="http://sphinx.pocoo.org/">Sphinx</a> developer docs we are bundling with the new cc.engine.  But I think that even without annotation, it is clear how much cleaner the new infrastructure is at than the old &#8220;present infrastructure&#8221; whiteboard drawing, which means that we are making good progress!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2009/12/18/understanding-the-state-of-sanity-via-whiteboards-and-ascii-art/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creative Commons Drupal Module &#8212; GSoC 2009</title>
		<link>http://labs.creativecommons.org/2009/09/03/creative-commons-drupal-module-gsoc-2009/</link>
		<comments>http://labs.creativecommons.org/2009/09/03/creative-commons-drupal-module-gsoc-2009/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 00:29:05 +0000</pubDate>
		<dc:creator>Blaise Alleyne</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[summer of code]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[GSoC]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=358</guid>
		<description><![CDATA[This past year was my last at the University of Toronto, making this summer my last chance to participate in the Google Summer of Code. I searched hard for a project and mentor organization that would suit my interests, and when I noticed that the Creative Commons Drupal module was in need of some developer [...]]]></description>
			<content:encoded><![CDATA[<p>This past year was my last at the <a href="http://individual.utoronto.ca/balleyne">University of Toronto</a>, making this summer my last chance to participate in the Google Summer of Code. I searched hard for a project and mentor organization that would suit my interests, and when I noticed that the <a href="http://drupal.org/project/creativecommons">Creative Commons Drupal module</a> was in need of some developer love, I knew exactly what I wanted to spend my summer doing. With <a href="http://creativecommons.org/about/people#112">John Doig</a> as my CC mentor, and <a href="http://drupal.org/user/48877">Kevin Reynen</a> (the module&#8217;s maintainer and initial author) as an unofficial Drupal mentor, I&#8217;ve been privileged to have spent the past few months updating and extending the module.</p>
<p>A couple years ago, development for Drupal 4.7 was begun, but it was never quite completed. <a href="http://drupal.org/project/creativecommons_lite">CC Lite</a> came to be the reliable choice for Drupal 6. However, CC Lite&#8217;s scope is limited &#8212; it allows you to attach a license to content in Drupal, but that&#8217;s about it. The main CC module&#8217;s vision is broader &#8212; to fully integrate CC technology with the Drupal platform &#8212; and I hope I&#8217;ve helped to realize that just a little.</p>
<p>Some of the module&#8217;s features:</p>
<ul>
<li>it uses the CC API for license selection and information (so, for example, when <a href="http://creativecommons.org/weblog/entry/15990">new license versions are released</a>, they become available on your Drupal site automatically)</li>
<li>you can set a site-wide default license/jurisdictoin, and user&#8217;s can set their own default license/jurisdiction</li>
<li>ccREL metadata is supported, output in RDFa (and, optionally, RDF/XML for legacy systems)</li>
<li>supports CC0, along with the 6 standard licenses and the Public Domain Certification tool</li>
<li>you can control which licenses and metadata fields are available to users</li>
<li>basic support for the Views API has been added (including a default /creativecommons view)</li>
<li>there&#8217;s a CC site search option</li>
</ul>
<p>The module is still listed as a beta release, as some folks have been submitting bug fixes and patches over the past few weeks, though it&#8217;s quite usable. Special thanks to <a href="http://drupal.org/user/463154">Turadg Aleahmad</a>, who&#8217;s helped with a lot of the recent bug fixes towards the end of the GSoC term, and committed to being active in future development. If you&#8217;re into Drupal development, we could use help with testing, and any translations would be greatly appreciated too.</p>
<p>Right now, the focus is on getting to a stable release, but we&#8217;ve got lots of ideas for the future too. Thanks to John and Kevin for their support through the summer, and to Turadg for his recent help. I look forward to seeing the module put to good use!</p>
<p><a href="http://drupal.org/project/creativecommons/"><strong>Check it out!</strong></a></p>
<p><em>I&#8217;m a musician, writer, software developer, free culture / free software advocate and recent graduate of the University of Toronto &#8212; get in touch at <a href="http://blaise.ca/">http://blaise.ca/</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2009/09/03/creative-commons-drupal-module-gsoc-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developers landing page revamp</title>
		<link>http://labs.creativecommons.org/2009/08/11/developers-landing-page-revamp/</link>
		<comments>http://labs.creativecommons.org/2009/08/11/developers-landing-page-revamp/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 20:08:22 +0000</pubDate>
		<dc:creator>Greg Grossmeier</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=336</guid>
		<description><![CDATA[If you haven&#8217;t looked at the Developers landing page on the Creative Commons wiki lately, you&#8217;re missing out!  We&#8217;ve recently put a lot of effort into reorganizing the information, making the important things easier to find, and overall just making the whole place a bit more welcoming.

First of all, we&#8217;ve made the semantic split [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t looked at the <a href="http://wiki.creativecommons.org/Developers">Developers</a> landing page on the Creative Commons wiki lately, you&#8217;re missing out!  We&#8217;ve recently put a lot of effort into reorganizing the information, making the important things easier to find, and overall just making the whole place a bit more welcoming.</p>
<p><img src="http://labs.creativecommons.org/files/2009/08/developer_redesign_screenshot1.png" alt="developer_redesign_screenshot" title="developer_redesign_screenshot" width="500" height="387" class="alignnone size-full wp-image-342" /></p>
<p>First of all, we&#8217;ve made the semantic split between information for <a href="http://wiki.creativecommons.org/Desktop_Integration">desktop-based development</a> and <a href="http://wiki.creativecommons.org/Web_Integration">web-based development</a>.  At each page there is a list (and short description) of the various tools to help you integrate CC-license metadata functionality and a short list of <a href="http://wiki.creativecommons.org/Developer_challenges">open Developer Challenges</a>.  These challenges are things the developer community think would be cool to have; a wishlist everyone can help with!</p>
<p>Also, we&#8217;re starting to produce some more &#8220;HowTo&#8221; guides for developers who are interested in the best practices of integrating CC-license metadata.  Thus far we have one for <a href="http://wiki.creativecommons.org/Web_Integration/HowTo">Web Integration</a> which lists the various ways a service could support CC licenses with best practices examples (pictoral and code) of how they did it.  See, for example, the page on <a href="http://wiki.creativecommons.org/Web_Integration/FileUploadExample">adding license choice when uploading content</a>.</p>
<p>We hope this redesign will make it easier for developers to find the information they need to improve their services.  If you have any other suggestions, don&#8217;t hesitate to send an email to <a href="mailto:greg@creativecommons.org">greg@creativecommons.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2009/08/11/developers-landing-page-revamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>License Engine path changes</title>
		<link>http://labs.creativecommons.org/2009/07/21/license-engine-path-changes/</link>
		<comments>http://labs.creativecommons.org/2009/07/21/license-engine-path-changes/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 23:19:57 +0000</pubDate>
		<dc:creator>Nathan Yergler</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=332</guid>
		<description><![CDATA[We just pushed out a resolution to Issue 381, updating the path to the license engine.  The license engine (the cc.engine application) is responsible for handling the license selection portions of the website as well as the deeds.  Some background may be helpful.
When we launched CC0 earlier this year we made a conscious [...]]]></description>
			<content:encoded><![CDATA[<p>We just pushed out a resolution to <a href="http://code.creativecommons.org/issues/issue381">Issue 381</a>, updating the path to the license engine.  The license engine (the <a href="http://code.creativecommons.org/viewsvn/cc.engine/">cc.engine</a> application) is responsible for handling the license selection portions of the website as well as the deeds.  Some background may be helpful.</p>
<p>When we launched CC0 earlier this year we made a conscious decision to locate the deed on a different path than the rest of the license deeds.  CC0 is a <em>waiver</em>, not a <em>license</em>, so the deed appropriately is located at <a href="http://creativecommons.org/publicdomain/zero/1.0/">http://creativecommons.org/publicdomain/zero/1.0/</a> (as opposed to the license deeds which URLs that look like <a href="http://creativecommons.org/licenses/by/3.0/">http://creativecommons.org/licenses/by/3.0/</a>).  At the time we decided to leave the CC0 chooser in the same group as the other choosers.  This unfortunately gave us a URL that contained <code>license</code> in it &#8212; <code>http://creativecommons.org/license/zero/</code> &#8212; which caused confusion for some users.  Is it a license or isn&#8217;t it?</p>
<p>It&#8217;s not.  </p>
<p>So starting this afternoon we&#8217;ve relocated the license engine to <a href="http://creativecommons.org/choose">http://creativecommons.org/choose</a> and CC0 to <a href="http://creativecommons.org/choose/zero">http://creativecommons.org/choose/zero</a>.  Redirects are in place so you shouldn&#8217;t notice any changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2009/07/21/license-engine-path-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git-svn with svn:externals</title>
		<link>http://labs.creativecommons.org/2009/07/21/git-svn-with-svnexternals/</link>
		<comments>http://labs.creativecommons.org/2009/07/21/git-svn-with-svnexternals/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 18:16:10 +0000</pubDate>
		<dc:creator>Nathan Yergler</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[gcs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git-svn]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=328</guid>
		<description><![CDATA[We&#8217;ve been slowly but surely moving projects from Subversion to git, but there are still large pieces of code that are sort of deadlocked in Subversion.  We make extensive use of svn:externals in our repository as a way to pull in dependencies and shared code (both within our repository and from other repositories, like [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been slowly but surely moving projects from Subversion to git, but there are still large pieces of code that are sort of deadlocked in Subversion.  We make extensive use of <code>svn:externals</code> in our repository as a way to pull in dependencies and shared code (both within our repository and from other repositories, like <a href="http://pypi.python.org/pypi/zc.buildout">zc.buildout&#8217;s</a> bootstrap).  This means that in order to convert something like the license engine (cc.engine) we need to also convert cc.license (which uses license_xsl), license.rdf and i18n.  Of course, the <a href="http://api.creativecommons.org">API</a> also uses license_xsl and the main site uses license.rdf.  Taking the time to move all of that wholesale isn&#8217;t something we have the time or desire to do right now.  It&#8217;s not just converting the repository &#8212; that&#8217;s the easy part; converting the deployments and surrounding tools is the real pain.</p>
<p>Last week I decided I wanted to use git to work on code currently in Subversion (my supporting tool chain really is that much better for git) and decided to check it out using git-svn.  And once again I was burned by our use of svn:externals.  So I wrote <strong>gsc</strong> &#8212; git subversion clone.  You can read more details <a href="http://yergler.net/blog/2009/07/21/git-svn-and-svnexternals/">on my blog</a> or find the code <a href="http://gitorious.org/gsc">on gitorious</a>.</p>
<p>Incidentally, cleaning up that dependency graph is very much on our radar.  I&#8217;m hoping to land work that we started last summer this fall that will remove some duplicated code and clean up the dependencies of the remaining code.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2009/07/21/git-svn-with-svnexternals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New validator released!</title>
		<link>http://labs.creativecommons.org/2009/01/06/new-validator-released/</link>
		<comments>http://labs.creativecommons.org/2009/01/06/new-validator-released/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 18:52:16 +0000</pubDate>
		<dc:creator>asheesh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[license engine]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[rdfa]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[summer of code]]></category>

		<guid isPermaLink="false">http://labs.creativecommons.org/?p=254</guid>
		<description><![CDATA[This past summer, Hugo Dworak worked with us (thanks to Google Summer of Code) on a new validator. This work was greatly overdue, and we are very pleased that Google could fund Hugo to work on it. Our previous validator had not been updated to reflect our new metadata standards, so we disabled it some [...]]]></description>
			<content:encoded><![CDATA[<p>This past summer, Hugo Dworak worked with us (<a href="http://labs.creativecommons.org/2008/05/26/license%E2%80%91oriented-metadata-validator-and-viewer-the-development-has-just-started/">thanks to Google Summer of Code</a>) on a new validator. This work was greatly overdue, and we are very pleased that Google could fund Hugo to work on it. Our previous validator had not been updated to reflect our new metadata standards, so we disabled it some time ago to avoid creating further confusion. The textbook on CC metadata is the <a href="http://wiki.creativecommons.org/CcREL">&#8220;Creative Commons Rights Expression Language&#8221;, or ccREL</a>, which specifies the use of RDFa on the web. (If this sounds like keyword soup, rest assured that the <a href="http://creativecommons.org/license/">License Engine</a> generates HTML that you can copy and paste; that HTML is fully compliant with ccREL.) We hoped Hugo&#8217;s work on a new validator would let us offer a validator to the Creative Commons community so that publishers can test their web pages to make sure they encode the information they intended.</p>
<p>Hugo&#8217;s work was a success; he <a href="http://labs.creativecommons.org/2008/08/16/license-oriented-metadata-validator-and-viewer-summertime-is-winding-up/">announced in August 2008 a test version of the validator</a>. He built on top of the work of others: the new validator uses the <a href="http://pylonshq.com/">Pylons</a> web framework, <a href="http://code.google.com/p/html5lib/">html5lib</a> for HTML parsing and tokenizing, and <a href="http://rdflib.net/">RDFlib</a> for working with RDF. He shared his source code under the recent free software license built for network services, <a href="http://www.fsf.org/licensing/licenses/agpl-3.0.html">AGPLv3</a>.</p>
<p>So I am happy to announce that the test period is complete, and we are now running the new code at <a href="http://validator.creativecommons.org/">http://validator.creativecommons.org/</a>. Our thanks go out to Hugo, and we look forward to the new validator gaining some use as well as hearing your feedback. If you want to contribute to the validator&#8217;s development or check it out for any reason, take a look at <a href="http://wiki.creativecommons.org/CcValidator">the documentation</a> on the CC wiki.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.creativecommons.org/2009/01/06/new-validator-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
