<?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>Jabbering Giraffe</title>
	<atom:link href="http://happygiraffe.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://happygiraffe.net/blog</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 20:49:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>jslint4java 2.0.2</title>
		<link>http://happygiraffe.net/blog/2012/02/07/jslint4java-2-0-2/</link>
		<comments>http://happygiraffe.net/blog/2012/02/07/jslint4java-2-0-2/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 20:45:27 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jslint]]></category>
		<category><![CDATA[jslint4java]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1717</guid>
		<description><![CDATA[After another long period of having nothing to say, I&#8217;ve pushed out an update to jslint4java. Version 2.0.2 doesn&#8217;t include any major new features, but does update JSLint to the latest version (2012-02-03) and fix a couple of small bugs &#8230; <a href="http://happygiraffe.net/blog/2012/02/07/jslint4java-2-0-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After another long period of having nothing to say, I&#8217;ve pushed out an update to <a href="http://code.google.com/p/jslint4java/">jslint4java</a>.  Version 2.0.2 doesn&#8217;t include any major new features, but does update <a href="http://jslint.com/">JSLint</a> to the latest version (2012-02-03) and fix a couple of small bugs here and there.</p>
<ul>
<li><a href="http://code.google.com/p/jslint4java/issues/detail?id=75">issue 75</a>: Handle BOMs when using the CLI.
<li> <a href="http://code.google.com/p/jslint4java/issues/detail?id=74">issue 74</a>: Document the technique for construction of JSLint objects.
<li> <a href="http://code.google.com/p/jslint4java/issues/detail?id=73">issue 73</a>: Better examples for maven configuration.
<li> <a href="http://code.google.com/p/jslint4java/issues/detail?id=72">issue 72</a> : Add all formatters to the maven plugin automatically.
<li> <a href="http://code.google.com/p/jslint4java/issues/detail?id=67">issue 67</a> : Fix maven docs.
<li>Update to JSLint 2012-02-03.
<ul>
<li>This removes the <code>adsafe</code>, <code>confusion</code> and <code>safe</code> options.
<li>This adds the <code>anon</code> option.
  </ul>
</ul>
<p>One minor point: Now that google code supports git repositories, I&#8217;m also pushing the source code <a href="http://code.google.com/p/jslint4java/source/browse/">there</a> again.  Github is still my “primary” but there&#8217;s another copy.  More copies are good.</p>
<p>I did spend a bit of time testing the CLI interface properly.  This isn&#8217;t really noteworthy, but it was entertaining for me, and hopefully results in fewer bugs like <a href="http://code.google.com/p/jslint4java/issues/detail?id=75">issue 75</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2012/02/07/jslint4java-2-0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jslint4java 2.0.1</title>
		<link>http://happygiraffe.net/blog/2011/10/19/jslint4java-2-0-1/</link>
		<comments>http://happygiraffe.net/blog/2011/10/19/jslint4java-2-0-1/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 10:40:06 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jslint]]></category>
		<category><![CDATA[jslint4java]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1692</guid>
		<description><![CDATA[Only about a month later than I had hoped, I&#8217;ve published jslint4java-2.0.1. The main change should be that the maven plugin is a bit better behaved. Plus of course, it&#8217;s using the latest version of JSLint.]]></description>
			<content:encoded><![CDATA[<p>Only about a month later than I had hoped, I&#8217;ve published <a href="http://code.google.com/p/jslint4java/#jslint4java-2.0.1">jslint4java-2.0.1</a>.  The main change should be that the maven plugin is a bit better behaved.  Plus of course, it&#8217;s using the latest version of <a href="http://jslint.com/">JSLint</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/10/19/jslint4java-2-0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jslint4java 2.0.0</title>
		<link>http://happygiraffe.net/blog/2011/07/15/jslint4java-2-0-0/</link>
		<comments>http://happygiraffe.net/blog/2011/07/15/jslint4java-2-0-0/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 16:18:46 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jslint4java]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1709</guid>
		<description><![CDATA[I&#8217;ve finally released jslint4java 2.0.0. It&#8217;s now available at code.google.com/p/jslint4java. The main new feature is that it now sports a maven plugin in addition to the ant task. There is also a breaking change, that&#8217;s been inherited from JSLint. The &#8230; <a href="http://happygiraffe.net/blog/2011/07/15/jslint4java-2-0-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally released <a href="http://code.google.com/p/jslint4java/#jslint4java-2.0.0">jslint4java 2.0.0</a>. It&#8217;s now available at <a href="http://code.google.com/p/jslint4java">code.google.com/p/jslint4java</a>.  The main new feature is that it now sports a maven plugin in addition to the ant task.</p>
<p>There is also a breaking change, that&#8217;s been inherited from <a href="http://jslint.com/">JSLint</a>.  The meaning of several options has been inverted.  Now, the default is to behave strictly, with options turned off.  For example, if you want to turn off JSLint&#8217;s checking of whitespace, you now have to specify <code>--white</code>.  Previously, this would <em>enable</em> checking of whitespace.  See the release notes for details, and please take care when updating.</p>
<p>The <a href="http://jslint4java.googlecode.com/svn/docs/2.0.0/maven.html">maven plugin</a> should behave much like any other maven plugin: you add it to your <code>&lt;build&gt;&lt;plugins&gt;</code> section.  Here&#8217;s an example:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #ddbb00;">&lt;</span>plugin<span style="color: #ddbb00;">&gt;</span>
  <span style="color: #ddbb00;">&lt;</span>groupId<span style="color: #ddbb00;">&gt;</span>com.googlecode.jslint4java<span style="color: #ddbb00;">&lt;</span>/groupId<span style="color: #ddbb00;">&gt;</span>
  <span style="color: #ddbb00;">&lt;</span>artifactId<span style="color: #ddbb00;">&gt;</span>jslint4java-maven-plugin<span style="color: #ddbb00;">&lt;</span>/artifactId<span style="color: #ddbb00;">&gt;</span>
  <span style="color: #ddbb00;">&lt;</span>version<span style="color: #ddbb00;">&gt;</span>2.0.0<span style="color: #ddbb00;">&lt;</span>/version<span style="color: #ddbb00;">&gt;</span>
  <span style="color: #ddbb00;">&lt;</span>executions<span style="color: #ddbb00;">&gt;</span>
    <span style="color: #ddbb00;">&lt;</span>execution<span style="color: #ddbb00;">&gt;</span>
      <span style="color: #ddbb00;">&lt;</span>id<span style="color: #ddbb00;">&gt;</span>lint<span style="color: #ddbb00;">&lt;</span>/id<span style="color: #ddbb00;">&gt;</span>
      <span style="color: #ddbb00;">&lt;</span>phase<span style="color: #ddbb00;">&gt;</span>process-resources<span style="color: #ddbb00;">&lt;</span>/phase<span style="color: #ddbb00;">&gt;</span>
      <span style="color: #ddbb00;">&lt;</span>goals<span style="color: #ddbb00;">&gt;</span>
        <span style="color: #ddbb00;">&lt;</span>goal<span style="color: #ddbb00;">&gt;</span>lint<span style="color: #ddbb00;">&lt;</span>/goal<span style="color: #ddbb00;">&gt;</span>
      <span style="color: #ddbb00;">&lt;</span>/goals<span style="color: #ddbb00;">&gt;</span>
      <span style="color: #ddbb00;">&lt;</span>configuration<span style="color: #ddbb00;">&gt;</span>
        <span style="color: #ddbb00;">&lt;</span>failOnError<span style="color: #ddbb00;">&gt;</span>true<span style="color: #ddbb00;">&lt;</span>/failOnError<span style="color: #ddbb00;">&gt;</span>
        <span style="color: #ddbb00;">&lt;</span>options<span style="color: #ddbb00;">&gt;</span>
          <span style="color: #ddbb00;">&lt;</span>undef<span style="color: #ddbb00;">&gt;</span>true<span style="color: #ddbb00;">&lt;</span>/undef<span style="color: #ddbb00;">&gt;</span>
        <span style="color: #ddbb00;">&lt;</span>/options<span style="color: #ddbb00;">&gt;</span>
      <span style="color: #ddbb00;">&lt;</span>/configuration<span style="color: #ddbb00;">&gt;</span>
    <span style="color: #ddbb00;">&lt;</span>/execution<span style="color: #ddbb00;">&gt;</span>
  <span style="color: #ddbb00;">&lt;</span>/executions<span style="color: #ddbb00;">&gt;</span>
<span style="color: #ddbb00;">&lt;</span>/plugin<span style="color: #ddbb00;">&gt;</span></pre></div></div>

<p>I&#8217;d love feedback on how well this works.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/07/15/jslint4java-2-0-0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Python configuration</title>
		<link>http://happygiraffe.net/blog/2011/04/28/python-configuration/</link>
		<comments>http://happygiraffe.net/blog/2011/04/28/python-configuration/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 21:08:00 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1707</guid>
		<description><![CDATA[At $WORK, there is a program that uses Python as its configuration. Leaving aside the moment of whether or not this is a good idea, I wanted to look at how it does this. All the program really needs is &#8230; <a href="http://happygiraffe.net/blog/2011/04/28/python-configuration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At $WORK, there is a program that uses Python as its configuration.  Leaving aside the moment of whether or not this is a good idea, I wanted to look at how it does this.</p>
<p>All the program <em>really</em> needs is a dictionary of configuration items.  But you can take advantage of it being Python to reduce duplication, generate some parts and so on.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># A much simplified example.</span>
&nbsp;
name = <span style="color: #483d8b;">'bob'</span>
&nbsp;
project = <span style="color: black;">&#123;</span>
  <span style="color: #483d8b;">'name'</span>: name,
  <span style="color: #483d8b;">'branch'</span>: name + <span style="color: #483d8b;">'_release_branch'</span>,
  <span style="color: #483d8b;">'packages'</span>: <span style="color: black;">&#91;</span>
    name + <span style="color: #483d8b;">'_frontend'</span>,
    name + <span style="color: #483d8b;">'_backend'</span>,
    name + <span style="color: #483d8b;">'_middleend'</span>,
  <span style="color: black;">&#93;</span>,
<span style="color: black;">&#125;</span></pre></div></div>

<p>How do you read this configuration file, without it having any untowards effects on your program?  Python has the <a href="http://docs.python.org/library/functions.html#execfile">execfile</a> builtin to do just this.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">scope = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
<span style="color: #008000;">execfile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bob.conf'</span>, scope<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">return</span> scope.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'project'</span>, <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Where it gets really interesting is when there are similar configs that want to share amongst themselves; you have to start <a href="http://docs.python.org/tutorial/modules.html">importing</a>.  Ideally, you&#8217;d like to be able to import from the same directory, so as to keep configuration together.  This leads to something like:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">conf_file = <span style="color: #483d8b;">'/some/where/bob.conf'</span>
oldsyspath = <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
  <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span> = <span style="color: black;">&#91;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>conf_file<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> + <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>
  scope = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
  <span style="color: #008000;">execfile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bob.conf'</span>, scope<span style="color: black;">&#41;</span>
  <span style="color: #ff7700;font-weight:bold;">return</span> scope.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'project'</span>, <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">finally</span>:
  <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span> = oldsyspath</pre></div></div>

<p>Of course, this leads to pollution.  If <code>bob.conf</code> imports <code>shared.py</code>, a permanent record is kept in <a href="http://docs.python.org/library/sys.html#sys.modules">sys.modules</a>.   So, if another <code>.conf</code> imports <code>shared.py</code>, you&#8217;d not load it from disk again; it would refer to the already imported file.</p>
<p>Which is probably OK, <em>unless</em> you&#8217;re dealing with different directories full of configuration.  Then, <code>import shared</code> may refer to different modules.  Yes, this is messy.  Yes, this is exactly what I was working on today.  <img src='http://happygiraffe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Now, we need to throw away any imports that are done by the config file.  Thankfully this is fairly easy.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">conf_file = <span style="color: #483d8b;">'/some/where/bob.conf'</span>
oldsyspath = <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>
oldsysmodules = <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">modules</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">try</span>:
  <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span> = <span style="color: black;">&#91;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>conf_file<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> + <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span>
  scope = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
  <span style="color: #008000;">execfile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'bob.conf'</span>, scope<span style="color: black;">&#41;</span>
  <span style="color: #ff7700;font-weight:bold;">return</span> scope.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'project'</span>, <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">finally</span>:
  <span style="color: #dc143c;">sys</span>.<span style="color: black;">path</span> = oldsyspath
  <span style="color: #ff7700;font-weight:bold;">for</span> name <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">modules</span><span style="color: black;">&#41;</span> - oldsysmodules:
    <span style="color: #ff7700;font-weight:bold;">del</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">modules</span><span style="color: black;">&#91;</span>name<span style="color: black;">&#93;</span></pre></div></div>

<p>Phew!  Now, I can read in all my configuration files from all over the system.</p>
<p>It&#8217;s not the end though.  It turned out that some of the configuration files did silly things with stdin, so we had to capture stdin, redirect to <code>/dev/null</code> and restore it after the <code>execfile()</code>.</p>
<p>Discussing with colleagues also revealed that the technique of cleaning up <code>sys.modules</code> could potentially cause trouble with modules that load <code>.so</code> files by not giving them a chance to clean up.  The suggested workaround was to use the <a href="http://docs.python.org/library/multiprocessing.html">multiprocessing</a> module to load the configuration in a separate process each time.  Thankfully, none of the configuration files in this system were affected by this.</p>
<p>Nonetheless, by this point, I can now read in all configuration files, and write out a big list of them as a <a href="http://docs.python.org/library/pickle.html">pickle</a> file.  Which lets me do some interesting analyses.</p>
<p>I guess the moral of this tale is that if you allow users access to a full programming language, <em>they will use it!</em>  The system that this originated in has several thousand configuration files, dating back up to five years.  There are a number of oddities lurking inside.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/04/28/python-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>django &amp; appengine</title>
		<link>http://happygiraffe.net/blog/2011/04/14/django-appengine/</link>
		<comments>http://happygiraffe.net/blog/2011/04/14/django-appengine/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 07:50:31 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[appengine]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1703</guid>
		<description><![CDATA[Last night I went to j4amie&#8216;s brightonpy talk Python and Django for PHP Refugees (slides). It was a really good talk, though I knew most of the Python stuff. The django intro was great however. What I was really interested &#8230; <a href="http://happygiraffe.net/blog/2011/04/14/django-appengine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last night I went to <a href="http://twitter.com/j4amie">j4amie</a>&#8216;s <a href="http://brightonpy.org/">brightonpy</a> talk <em>Python and Django for PHP Refugees</em> (<a href="http://j4mie.github.com/python-and-django-for-php-refugees/">slides</a>).  It was a really good talk, though I knew most of the Python stuff.  The django intro was great however.</p>
<p>What I was really interested in was using Django together with appengine.  I&#8217;ve used appengine before with the builtin <a href="http://code.google.com/appengine/docs/python/tools/webapp/">webapp framework</a>.  Whilst it&#8217;s good, it&#8217;s simplistic and I found myself building layers on top quickly.</p>
<p>Looking through the docs, the first thing I see is <a href="http://code.google.com/appengine/articles/django.html">Running Django on Google App Engine</a>.  But this says that the builtin django is obsolete and I should be using <a href="http://www.allbuttonspressed.com/projects/django-nonrel">django-nonrel</a>.  There is further documentation on this, <a href="http://code.google.com/appengine/articles/django-nonrel.html">Running Pure Django Projects on Google App Engine</a>.  This approach is interesting.  It&#8217;s encouraging you to not be <em>appengine</em> specific, the way that you are with webapp&#8217;s default setup.</p>
<p>django-nonrel is made up of several components; you should start by looking at <a href="http://www.allbuttonspressed.com/projects/djangoappengine">djangoappengine</a>.  You&#8217;ll need to download all five components.</p>
<ul>
<li><a href="http://bitbucket.org/wkornewald/django-nonrel/get/tip.zip">django-nonrel</a>
<li><a href="http://bitbucket.org/wkornewald/djangoappengine/get/tip.zip">djangoappengine</a>
<li> <a href="http://bitbucket.org/wkornewald/djangotoolbox/get/tip.zip">djangotoolbox</a>
<li> <a href="http://bitbucket.org/wkornewald/django-dbindexer/get/tip.zip">django-dbindexer</a>
<li> <a href="http://bitbucket.org/wkornewald/django-testapp/get/tip.zip">django-testapp</a> (strictly, this is optional, but it&#8217;s a good idea for referring to)
</ul>
<p>You&#8217;ll also need the <a href="http://code.google.com/p/googleappengine/downloads/list">appengine SDK</a> in case you don&#8217;t have it.</p>
<p>Once you&#8217;ve downloaded everything, import the necessary bits into a project you made with the appengine SDK.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">pwd</span>
<span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>dom<span style="color: #000000; font-weight: bold;">/</span>work
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #007800;">$APPENGINE_SDK</span><span style="color: #000000; font-weight: bold;">/</span>new_project_template hellodjango
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">cd</span> hellodjango
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>wkornewald-django-nonrel-c73e6ca3843d<span style="color: #000000; font-weight: bold;">/</span>django .
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>wkornewald-djangotoolbox-f79fecb60e6d<span style="color: #000000; font-weight: bold;">/</span>djangotoolbox .
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>wkornewald-django-dbindexer-48589f5faad4<span style="color: #000000; font-weight: bold;">/</span>dbindexer . 
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>wkornewald-djangoappengine-f9175cf4c8bd djangoappengine
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
total <span style="color: #000000;">24</span>
-rwxr-x---<span style="color: #000000; font-weight: bold;">@</span>  <span style="color: #000000;">1</span> dom  <span style="color: #000000;">5000</span>   <span style="color: #000000;">106</span> <span style="color: #000000;">13</span> Apr <span style="color: #000000;">12</span>:09 app.yaml<span style="color: #000000; font-weight: bold;">*</span>
drwxr-xr-x<span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">12</span> dom  <span style="color: #000000;">5000</span>   <span style="color: #000000;">408</span> <span style="color: #000000;">13</span> Apr <span style="color: #000000;">12</span>:<span style="color: #000000;">43</span> dbindexer<span style="color: #000000; font-weight: bold;">/</span>
drwxr-xr-x<span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">18</span> dom  <span style="color: #000000;">5000</span>   <span style="color: #000000;">612</span> <span style="color: #000000;">13</span> Apr <span style="color: #000000;">12</span>:<span style="color: #000000;">33</span> django<span style="color: #000000; font-weight: bold;">/</span>
drwxr-xr-x<span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">23</span> dom  <span style="color: #000000;">5000</span>   <span style="color: #000000;">782</span> <span style="color: #000000;">13</span> Apr <span style="color: #000000;">12</span>:<span style="color: #000000;">43</span> djangoappengine<span style="color: #000000; font-weight: bold;">/</span>
drwxr-xr-x<span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">15</span> dom  <span style="color: #000000;">5000</span>   <span style="color: #000000;">510</span> <span style="color: #000000;">13</span> Apr <span style="color: #000000;">12</span>:<span style="color: #000000;">43</span> djangotoolbox<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #660033;">-rwxr-x---</span>   <span style="color: #000000;">1</span> dom  <span style="color: #000000;">5000</span>   <span style="color: #000000;">472</span> <span style="color: #000000;">24</span> Mar <span style="color: #000000;">23</span>:<span style="color: #000000;">38</span> index.yaml<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #660033;">-rwxr-x---</span>   <span style="color: #000000;">1</span> dom  <span style="color: #000000;">5000</span>  <span style="color: #000000;">1002</span> <span style="color: #000000;">24</span> Mar <span style="color: #000000;">23</span>:<span style="color: #000000;">38</span> main.py<span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>You&#8217;ll have to bundle all of this with your app.  You may want to delete some bits of <code>django/contrib</code> that you don&#8217;t use.</p>
<p>Now, how to get started with my app?  I&#8217;ll need to create a django <em>project</em>.  Normally I use the installed <code>django-admin.py</code>.  In this case, I&#8217;d like to use the version I&#8217;ve imported to my project.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #007800;">PYTHONPATH</span>=. django<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>django-admin.py 
Usage: django-admin.py subcommand <span style="color: #7a0874; font-weight: bold;">&#91;</span>options<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>args<span style="color: #7a0874; font-weight: bold;">&#93;</span>
…
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #007800;">PYTHONPATH</span>=. django<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>django-admin.py startproject hellodjango
<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> hellodjango<span style="color: #000000; font-weight: bold;">/*</span> .
<span style="color: #000000; font-weight: bold;">%</span></pre></div></div>

<p>So now how do I hook that up to <code>app.yaml</code>?  There&#8217;s no documentation, but there is a test app.  And that contains the magic snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">handlers:
- url: <span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #000000; font-weight: bold;">*</span>
  script: djangoappengine<span style="color: #000000; font-weight: bold;">/</span>main<span style="color: #000000; font-weight: bold;">/</span>main.py</pre></div></div>

<p>Now, how do I run this?  The appengine launcher I&#8217;m using has a “play” button.  My first attempt broke, because I&#8217;d made the app in the <code>hellodjango</code> directory, the settings contained a reference to <code>hellodjango.urls</code>, which should be just <code>urls</code>.  With that fixed, I get an “It worked!” page.  Result!</p>
<p>The <code>dev_appserver.py</code> approach (aka the play button) worked for me, but the djangoappengine docs say to use <code>./manage.py runserver</code>, so I&#8217;ll do that.</p>
<p>Now, I have an empty app.  Let&#8217;s add in a minimal hello world view.  First, I create <code>views.py</code></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">http</span> <span style="color: #ff7700;font-weight:bold;">import</span> HttpResponse
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> home<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;h1&gt;Hello World&lt;/h1&gt;'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>And then adjust <code>urls.py</code> to point to it.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">from django.conf.urls.defaults import patterns, include, url
&nbsp;
import views
&nbsp;
urlpatterns = patterns('',
  url(r'^$', views.home, name='home'),
)</pre></div></div>

<p>I now see the <em>Hello World!</em> displayed in my browser.  I&#8217;d like to get a nice template working.  I&#8217;ll update my views to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">shortcuts</span> <span style="color: #ff7700;font-weight:bold;">import</span> render
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> home<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">return</span> render<span style="color: black;">&#40;</span>request, <span style="color: #483d8b;">'home.html'</span><span style="color: black;">&#41;</span></pre></div></div>

<p><code>templates/home.html</code> is as you would expect.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;h1&gt;Hello World!&lt;/h1&gt;</pre></div></div>

<p>The final piece of the puzzle: how does django know where to find the template?  In settings.py, there&#8217;s a <em>TEMPLATE_DIRS</em> setting.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">TEMPLATE_DIRS = <span style="color: black;">&#40;</span>
  <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span>__file__<span style="color: black;">&#41;</span>, <span style="color: #483d8b;">'templates'</span><span style="color: black;">&#41;</span>,
<span style="color: black;">&#41;</span></pre></div></div>

<p>At this point, you&#8217;re using regular django, and should be able to use the regular docs to carry on.  Although, please read the list of <a href="http://www.allbuttonspressed.com/projects/djangoappengine#supported-and-unsupported-features">djangoappengine caveats</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/04/14/django-appengine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSGI Intro</title>
		<link>http://happygiraffe.net/blog/2011/03/31/osgi-intro/</link>
		<comments>http://happygiraffe.net/blog/2011/03/31/osgi-intro/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 18:49:58 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[osgi]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1701</guid>
		<description><![CDATA[On Tuesday, I attended the OSGI: Let&#8217;s Get Started session with Simon Maple and Zoë Slattery, courtesy of SkillsMatter and LJC. I figured it&#8217;s time to figure out what I am supposed to be doing with it. For the last &#8230; <a href="http://happygiraffe.net/blog/2011/03/31/osgi-intro/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On Tuesday, I attended the <a href="http://skillsmatter.com/event/java-jee/osgi-lets-get-started">OSGI: Let&#8217;s Get Started</a> session with <a href="http://twitter.com/sjmaple">Simon Maple</a> and <a href="http://twitter.com/zoe_slattery">Zoë Slattery</a>, courtesy of <a href="http://skillsmatter.com/">SkillsMatter</a> and <a href="http://www.meetup.com/Londonjavacommunity/">LJC</a>.  I figured it&#8217;s time to figure out what I am <em>supposed</em> to be doing with it. <code> <img src='http://happygiraffe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </code></p>
<p><!--TODO: presenter names--></p>
<p>For the last release I enabled OSGI headers for jslint4java.  I was hoping that this session would show me how I fared in that.</p>
<p>First, what is <a href="http://www.osgi.org/Main/HomePage" title="Open Systems Gateway Initiative">OSGI</a>?  At the most basic, it&#8217;s a way of providing some order and structure to the traditional Java classpath.  OSGI achieves this by using <em>bundles</em>.</p>
<p>A <em>bundle</em> is a regular jar file, but with additional metadata in <code>META-INF/MANIFEST.MF</code>.  Details like the name, version and dependencies.  The dependencies are interesting.  A bundle <em>can</em> depend directly on other bundles, but that&#8217;s discouraged.  A better approach is to specify that you depend on java packages.  That way you don&#8217;t have to tie yourself to a particular provider of a package.</p>
<p>When OSGI loads in a bundle, it gives each bundle a unique <a href="http://download.oracle.com/javase/6/docs/api/java/lang/ClassLoader.html">ClassLoader</a>.  This means that:</p>
<ul>
<li>
<p>You can have multiple versions of bundles loaded simultaneously.  You don&#8217;t have to force everything to the same version.</p>
<li>
<p>Each bundle can <em>only</em> see classes that have been explicitly exported by its dependencies, not the whole transitive closure.  This is very good for keeping your code clean.</p>
<p>This also leads to a pattern I&#8217;ve seen before in the maven world: separate artifacts for APIs vs implementation.  Pulling out interfaces is generally a good idea.  But by putting them in a separate OSGI bundle, you enforce that your implementation can remain invisible.  Even the “hello OSGI world” demo was shown this way.</p>
</ul>
<p>On top of this metadata, OSGI provides a runtime for loading and unloading bundles.  The runtime also supports the concept of <em>services</em>, where you can ask the runtime for various services.  This looks cool, but the dynamicity of it can be hard to deal with—that service you got from the runtime can disappear at any point.  There was a demo of something called <a href="http://www.ibm.com/developerworks/opensource/library/os-osgiblueprint/">blueprint</a>, which aims to help, but it looked almost exactly like “more Spring XML” to me.  If I was doing this, I&#8217;d look at <a href="http://code.google.com/p/peaberry/">peaberry</a> instead.</p>
<p>How do you go about getting started with OSGI?  Well, you could manage the bundle metadata yourself, but it&#8217;s much easier to use a tool to do it for you.  One such tool was demo&#8217;d: <a href="http://www.aqute.biz/Code/Bnd">bnd</a>.  The <a href="http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html">maven-bundle-plugin</a> that I used for jslint4java builds on bnd.</p>
<p>If you need a runtime for your app, there are two in common use: <a href="http://www.eclipse.org/equinox/">Equinox</a> and <a href="http://www.eclipse.org/equinox/">Felix</a>.  Equinox is the runtime used by Eclipse.</p>
<p>For followup detail, they recommended checking out anything by <a href="http://njbartlett.name/">Neil Bartlett</a>.  It&#8217;s a shame he couldn&#8217;t make it.</p>
<p>Overall I was pretty impressed.  It made me realise that I got the basics right, and I know where I need to go when I need more.  Thanks, guys!</p>
<p>Having written all this, I&#8217;ve just realised the the <a href="http://en.wikipedia.org/wiki/OSGi">wikipedia page on OSGI</a> demonstrates nearly all of it, and with examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/03/31/osgi-intro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jslint4java-1.4.7</title>
		<link>http://happygiraffe.net/blog/2011/03/11/jslint4java-1-4-7/</link>
		<comments>http://happygiraffe.net/blog/2011/03/11/jslint4java-1-4-7/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 12:50:38 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jslint4java]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1697</guid>
		<description><![CDATA[I&#8217;ve released a minor update, 1.4.7. It&#8217;s available from the usual place. What&#8217;s new? Added OSGI bundle headers. I&#8217;m an OSGI novice; please let me know if these are wrong. issue 52: Add checkstyle xml formatter. issue 53: No files &#8230; <a href="http://happygiraffe.net/blog/2011/03/11/jslint4java-1-4-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve released a minor update, <a href="http://code.google.com/p/jslint4java/#jslint4java-1.4.7">1.4.7</a>.  It&#8217;s available from the <a href="http://code.google.com/p/jslint4java/downloads/list">usual place</a>.</p>
<p>What&#8217;s new?</p>
<ul>
<li>Added OSGI bundle headers.
<ul>
<li>I&#8217;m an OSGI novice; please let me know if these are wrong.
  </ul>
<li><a href="http://code.google.com/p/jslint4java/issues/detail?id=52">issue 52</a>: Add checkstyle xml formatter.
<li><a href="http://code.google.com/p/jslint4java/issues/detail?id=53">issue 53</a>: No files passed to the ant task is no longer an error (just an info message).
<li>Update to JSLint 2011-03-07.
<ul>
<li> This adds the <code>continue</code> option, whilst removing <code>eqeqeq</code>, <code>immed</code> and <code>laxbreak</code> options.
<li> JSLints interpretation of line and column numbers has changed. I&#8217;ve tried to keep up. Please file a bug if errors aren&#8217;t reported at the expected place.
  </ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/03/11/jslint4java-1-4-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pruning your tree</title>
		<link>http://happygiraffe.net/blog/2011/02/25/pruning-your-tree/</link>
		<comments>http://happygiraffe.net/blog/2011/02/25/pruning-your-tree/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 21:28:46 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1693</guid>
		<description><![CDATA[This is from a mailing list post I&#8217;ve just replied to. Since I had to look it up, it&#8217;s worth blogging. It seems like a simple task. Find all the files in the current directory, excluding .svn directories. I&#8217;ve mocked &#8230; <a href="http://happygiraffe.net/blog/2011/02/25/pruning-your-tree/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is from a mailing list <a href="https://groups.google.com/d/topic/brightonnewmedia/DNl7jBFr3FI/discussion">post</a> I&#8217;ve just replied to.  Since I had to look it up, it&#8217;s worth blogging. <img src='http://happygiraffe.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It seems like a simple task.  Find all the files in the current directory, excluding <code>.svn</code> directories.  I&#8217;ve mocked up a simple layout.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">find</span> .
.
.<span style="color: #000000; font-weight: bold;">/</span>.svn
.<span style="color: #000000; font-weight: bold;">/</span>.svn<span style="color: #000000; font-weight: bold;">/</span>README.txt
.<span style="color: #000000; font-weight: bold;">/</span>README.txt
.<span style="color: #000000; font-weight: bold;">/</span>src
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>.svn
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>.svn<span style="color: #000000; font-weight: bold;">/</span>foo.c
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>foo.c</pre></div></div>

<p>By default, find prints out everything.  But we only want files.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f
.<span style="color: #000000; font-weight: bold;">/</span>.svn<span style="color: #000000; font-weight: bold;">/</span>README.txt
.<span style="color: #000000; font-weight: bold;">/</span>README.txt
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>.svn<span style="color: #000000; font-weight: bold;">/</span>foo.c
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>foo.c</pre></div></div>

<p>Now, we want to exclude everything under <code>.svn</code>.  Easy.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> .svn <span style="color: #660033;">-prune</span> <span style="color: #660033;">-type</span> f</pre></div></div>

<p>Ooops.  That&#8217;s not good.  What happened here?  Well, the default for find is to <em>and</em> two expressions together.  If we or it, we get what we want.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> .svn <span style="color: #660033;">-prune</span> <span style="color: #660033;">-or</span> <span style="color: #660033;">-type</span> f
.<span style="color: #000000; font-weight: bold;">/</span>.svn
.<span style="color: #000000; font-weight: bold;">/</span>README.txt
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>.svn
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>foo.c</pre></div></div>

<p>Again, not so good.  The problem is that default action to print everything.  Because we&#8217;ve specified no action, it&#8217;ll print out each match, and that includes the <code>.svn</code> directories (even though it correctly stops going into them).</p>
<p>The answer is to provide an explicit action instead.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> .svn <span style="color: #660033;">-prune</span> <span style="color: #660033;">-or</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-print</span>
.<span style="color: #000000; font-weight: bold;">/</span>README.txt
.<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>foo.c</pre></div></div>

<p>This works, because now there is no default action, and the explicit action is only associated with the <code>-type f</code> predicate.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/02/25/pruning-your-tree/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>jslint4java status</title>
		<link>http://happygiraffe.net/blog/2011/02/24/jslint4java-status/</link>
		<comments>http://happygiraffe.net/blog/2011/02/24/jslint4java-status/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 09:39:29 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jslint4java]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1689</guid>
		<description><![CDATA[I&#8217;ve done a few releases of jslint4java whilst this blog has been down. We&#8217;re presently at 1.4.6. It&#8217;s mostly been bug fixes and JSLint upgrades. What&#8217;s really interesting has been paying attention to the integrations that people have come up &#8230; <a href="http://happygiraffe.net/blog/2011/02/24/jslint4java-status/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done a few releases of <a href="http://code.google.com/p/jslint4java">jslint4java</a> whilst this blog has been down.  We&#8217;re presently at <a href="http://code.google.com/p/jslint4java/#jslint4java-1.4.6">1.4.6</a>.  It&#8217;s mostly been bug fixes and JSLint upgrades.</p>
<p>What&#8217;s really interesting has been paying attention to the integrations that people have come up with.  It&#8217;s never been easier to have lint-free JavaScript!</p>
<dl>
<dt>Sonar</p>
<dd>If you use the sonar code quality tool, check out the <a href="http://docs.codehaus.org/display/SONAR/JavaScript+Plugin">javascript-plugin-for-sonar</a> which uses jslint4java.</p>
<dt> <del>Hudson</del>Jenkins</p>
<dd> The <a href="http://wiki.hudson-ci.org/display/HUDSON/Violations">hudson violations plugin</a> can display JSLint errors in your project.  You still have to arrange to run jslint4java as part of your build though.</p>
<dt> Emacs</p>
<dd> Want to run JSLint inside Emacs?  Have a look at <a href="https://gist.github.com/769416">this gist</a>.</p>
<dt> Gradle</p>
<dd> Do you use gradle for your builds?  <a href="http://www.kellyrob99.com/blog/">kellyrob99</a> has produced a <a href="https://github.com/kellyrob99/gradle-jslint-plugin">gradle-jslint-plugin</a>.</p>
<dt> Mercurial</p>
<dd> Want to run JSLint automatically when using mercurial?  Take a look at <a href="http://katratxo.wordpress.com/2010/12/13/running-jslint-as-hg-precommit-hook/">Running JSLint as Mercurial precommit hook</a>.</p>
<dt> Netbeans</p>
<dd> Check out <a href="http://blogs.sun.com/ashamash/entry/integrating_jslint_more_tightly_into">Integrating JSLint more tightly into NetBeans</a>.</p>
<dt> Maven</p>
<dd> Whilst there&#8217;s a <a href="https://github.com/happygiraffe/jslint4java/tree/maven-plugin">jslint4java maven plugin</a> in the works, <a href="http://stackoverflow.com/questions/92372/maven-plugins-for-javascript">this stackoverflow post</a> describes several ways of integrating JSLint with Maven.</p>
<dt> Phonegap</p>
<dd> If you&#8217;re doing Phonegap development, the latest version of the <a href="http://code.google.com/a/eclipselabs.org/p/mobile-web-development-with-phonegap/">eclipse plugin</a> comes with JSLint.</p>
</dl>
<p>If you develop an open source project, then you really should set up a <a href="http://www.google.com/alerts">google alert</a> for its name.  You <em>will</em> be surprised.</p>
<p>What&#8217;s coming up?</p>
<ul>
<li> Update to the latest <a href="https://github.com/douglascrockford/JSLint/">JSLint</a> (as always).  Doug Crockford recently did a major rewrite.  I think I&#8217;ve got that mostly integrated now, but not released.
<li>There are a <a href="http://code.google.com/p/jslint4java/issues/list">few outstanding bugs</a> that I need to pay attention to.
<li>I&#8217;ve also been working on my own <a href="https://github.com/happygiraffe/jslint4java-eclipse">jslint4java-eclipse</a> plugin, which feels nearly complete enough to release.
<li> Assuming I can ever figure out the integration testing, I&#8217;ll go back and finish off the <a href="https://github.com/happygiraffe/jslint4java/tree/maven-plugin">jslint4java-maven-plugin</a>.
</ul>
<p>Plenty to keep busy with!</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/02/24/jslint4java-status/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tap Tap Tap</title>
		<link>http://happygiraffe.net/blog/2011/02/24/tap-tap-tap/</link>
		<comments>http://happygiraffe.net/blog/2011/02/24/tap-tap-tap/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 08:11:34 +0000</pubDate>
		<dc:creator>Dominic Mitchell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://happygiraffe.net/blog/?p=1683</guid>
		<description><![CDATA[Hmmm, this has been off for a while, hasn&#8217;t it. My server (previously hosted in spare bedroom) died. “Fine!” says I. “To the free blog hosting!” If only it were that simple. After looking at wordpress, Blogger, Tumblr and Posterous, &#8230; <a href="http://happygiraffe.net/blog/2011/02/24/tap-tap-tap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hmmm, this has been off for a while, hasn&#8217;t it.</p>
<p>My server (previously hosted in spare bedroom) died.  “Fine!” says I.  “To the free blog hosting!”  If only it were that simple.</p>
<p>After looking at wordpress, Blogger, Tumblr and Posterous, I realised none of them would allow me to retain my existing URLs.  All because I originally chose to install at <em>happygiraffe.net<strong>/blog</strong></em>.  Silly me.  The free providers allow you to put stuff at the root of a domain only.  Plus other restrictions made the choice inappropriate.  So, it&#8217;s back to hosted wordpress.</p>
<p>Anyway, after some initial shenanigans with getting the backup restored, this blog should be back in business.  Sorry about the outage.</p>
<p>P.S.  Yes, URLs are important.  Jeremy is <a href="http://adactio.com/journal/4381/">putting his money where his mouth is</a>.  I sincerely hope he doesn&#8217;t win.</p>
]]></content:encoded>
			<wfw:commentRss>http://happygiraffe.net/blog/2011/02/24/tap-tap-tap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 3.977 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-22 08:37:20 -->
<!-- Compression = gzip -->
