<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Casey W. Stark]]></title>
  <link href="http://caseywstark.com/atom.xml" rel="self"/>
  <link href="http://caseywstark.com/"/>
  <updated>2012-02-18T19:17:58-08:00</updated>
  <id>http://caseywstark.com/</id>
  <author>
    <name><![CDATA[Casey W. Stark]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Code Release: Dimensionful]]></title>
    <link href="http://caseywstark.com/blog/2012/code-release-dimensionful/"/>
    <updated>2012-02-18T19:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2012/code-release-dimensionful</id>
    <content type="html"><![CDATA[<p>I&#8217;m releasing a Python package I named <a href="http://github.com/caseywstark/dimensionful">dimensionful</a>. It&#8217;s a simple library that attaches symbolic units to any sort of data.</p>

<p>The idea is that you can create <code>Unit</code> objects and associate them to any data, using a <code>Quantity</code> object. You can then perform any operation on the Quantity objects and the units are handled behind the scenes for you, with as few conversions as necessary (almost always zero).</p>

<p>Here&#8217;s an example to give you an idea of how it works.</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
</span><span class='line'><span class="kn">from</span> <span class="nn">dimensionful</span> <span class="kn">import</span> <span class="n">Unit</span><span class="p">,</span> <span class="n">Quantity</span>
</span><span class='line'>
</span><span class='line'><span class="c"># totally fake data</span>
</span><span class='line'><span class="n">energy_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
</span><span class='line'><span class="n">time_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
</span><span class='line'>
</span><span class='line'><span class="c"># Create a Unit. Dimensionful knows the unit symbols &quot;g&quot;, &quot;cm&quot;, and</span>
</span><span class='line'><span class="c"># &quot;s&quot;, but you can provide any string or sympy expression.</span>
</span><span class='line'><span class="n">energy_units</span> <span class="o">=</span> <span class="n">Unit</span><span class="p">(</span><span class="s">&quot;g * cm**2 * s**-2&quot;</span><span class="p">)</span>
</span><span class='line'>
</span><span class='line'><span class="c"># Create a Quantity. First argument is the data, second is the units. The unit</span>
</span><span class='line'><span class="c"># arg can be a Unit object or a string.</span>
</span><span class='line'><span class="n">energies</span> <span class="o">=</span> <span class="n">Quantity</span><span class="p">(</span><span class="n">energy_data</span><span class="p">,</span> <span class="n">energy_units</span><span class="p">)</span>
</span><span class='line'><span class="n">time_intervals</span> <span class="o">=</span> <span class="n">Quantity</span><span class="p">(</span><span class="n">time_data</span><span class="p">,</span> <span class="s">&quot;s&quot;</span><span class="p">)</span>
</span><span class='line'>
</span><span class='line'><span class="c"># Try Quantity operations</span>
</span><span class='line'><span class="n">power</span> <span class="o">=</span> <span class="n">energies</span> <span class="o">/</span> <span class="n">time_intervals</span>
</span><span class='line'><span class="k">print</span> <span class="n">power</span>
</span></code></pre></td></tr></table></div></figure>


<p>This outputs <code>[ 0.84771033  1.01795928  0.34694982  0.26888805] cm**2*g/s**3</code>. And a brief version of the same thing:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">from</span> <span class="nn">dimensionful</span> <span class="kn">import</span> <span class="n">Quantity</span><span class="p">,</span> <span class="n">erg</span><span class="p">,</span> <span class="n">s</span>
</span><span class='line'>
</span><span class='line'><span class="k">print</span> <span class="n">Quantity</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span> <span class="n">erg</span><span class="p">)</span> <span class="o">/</span> <span class="n">Quantity</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">random</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span> <span class="n">s</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>


<p>This package is similar to <a href="http://juanreyero.com/open/magnitude/">magnitude</a> and <a href="http://docs.sympy.org/dev/modules/physics/units.html">sympy.physics.units</a>, but I think there are some key differences.</p>

<!-- more -->




<h3>Symbolic Units</h3>


<p>If I want to express some of my data in &#8220;M_solar / yr * s&#8221;, I do not want it automatically converted to &#8220;kg&#8221;. This is at least one unnecessary operation and is almost always not what I want.</p>

<p>Rather than carrying around powers of SI base units or automatically converting to SI, dimensionful understands that your units are mathematical symbols and should be treated as such. They are never reduced to other units until you ask for that.</p>

<p>Example using the Hubble rate:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">h</span> <span class="o">=</span> <span class="mf">0.71</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">H_0</span> <span class="o">=</span> <span class="n">Quantity</span><span class="p">(</span><span class="mi">100</span> <span class="o">*</span> <span class="n">h</span><span class="p">,</span> <span class="s">&quot;km / s / Mpc&quot;</span><span class="p">)</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="k">print</span> <span class="n">H_0</span>
</span><span class='line'><span class="mf">71.0</span> <span class="n">km</span><span class="o">/</span><span class="p">(</span><span class="n">Mpc</span><span class="o">*</span><span class="n">s</span><span class="p">)</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="k">print</span> <span class="n">H_0</span><span class="o">.</span><span class="n">get_in</span><span class="p">(</span><span class="s">&quot;s**-1&quot;</span><span class="p">)</span>
</span><span class='line'><span class="mf">2.30095149205362e-18</span> <span class="mi">1</span><span class="o">/</span><span class="n">s</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">time_interval</span> <span class="o">=</span> <span class="n">Quantity</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="s">&quot;s&quot;</span><span class="p">)</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="k">print</span> <span class="n">H_0</span> <span class="o">*</span> <span class="n">time_interval</span>
</span><span class='line'><span class="mf">7100.0</span> <span class="n">km</span><span class="o">/</span><span class="n">Mpc</span>
</span></code></pre></td></tr></table></div></figure>


<p>Although km / Mpc is just a number, dimensionful does not convert it until you ask for the Hubble rate in inverse seconds.</p>

<h3>Dimensionality-based</h3>


<p>Each Unit object has an attribute called <code>dimensions</code>. This a symbolic expression of a Unit&#8217;s dimensionality, made up of &#8220;mass&#8221;, &#8220;length&#8221;, &#8220;time&#8221;, and &#8220;temperature&#8221; symbols.</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="kn">from</span> <span class="nn">dimensionful</span> <span class="kn">import</span> <span class="n">erg</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">erg</span><span class="o">.</span><span class="n">dimensions</span>
</span><span class='line'><span class="p">(</span><span class="n">length</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="p">(</span><span class="n">mass</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">time</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
</span></code></pre></td></tr></table></div></figure>


<p>This is what allows dimensionful to understand the relationships between different units. If I have data with dimensions <code>(length)**2*(mass)/(time)**2</code>, I know that I can&#8217;t convert to units with dimensions <code>(length)**2*(mass)/(time)</code>.</p>

<p>In this system, Units are combinations of dimensions and a reference value. I chose to use cgs for reference values, so each Unit object has the attributes <code>dimensions</code> and <code>cgs_value</code>:</p>

<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">J</span> <span class="o">=</span> <span class="n">Unit</span><span class="p">(</span><span class="s">&quot;J&quot;</span><span class="p">)</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">J</span><span class="o">.</span><span class="n">dimensions</span>
</span><span class='line'><span class="p">(</span><span class="n">length</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="o">*</span><span class="p">(</span><span class="n">mass</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">time</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span>
</span><span class='line'><span class="o">&gt;&gt;&gt;</span> <span class="n">J</span><span class="o">.</span><span class="n">cgs_value</span>
</span><span class='line'><span class="mf">10000000.0</span>
</span></code></pre></td></tr></table></div></figure>




<h3>Base units</h3>


<p>Most unit libraries are <a href="http://en.wikipedia.org/wiki/SI_base_unit">SI</a> based. In my opinion, <a href="http://en.wikipedia.org/wiki/Cgs">cgs</a> is a much better system for your base units. The typical reasons are that there are fewer base units and your E&amp;M laws are simpler. See <a href="http://en.wikipedia.org/wiki/Gaussian_units">http://en.wikipedia.org/wiki/Gaussian_units</a> for more info.</p>

<h2>Check it out</h2>


<p>The code is public at <a href="http://github.com/caseywstark/dimensionful">http://github.com/caseywstark/dimensionful</a>. I decided license it under BSD to keep the legal stuff simple. There are a decent number of tests included (run them with <code>nosetests</code>), but it&#8217;s still fairly new. Let me know what you think if you tinker with it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Domain change]]></title>
    <link href="http://caseywstark.com/blog/2012/domain-change/"/>
    <updated>2012-01-02T23:02:00-08:00</updated>
    <id>http://caseywstark.com/blog/2012/domain-change</id>
    <content type="html"><![CDATA[<p>My new personal website is <a href="http://caseywstark.com">caseywstark.com</a>.</p>

<p>I decided to get rid of &#8220;thestarkeffect&#8221; and thestarkeffect.com. Even if you know the physics phenomenon, it&#8217;s a bit too dorky for me now. If you don&#8217;t know it, it sounds&#8230; bad.</p>

<p>I will leave thestarkeffect.com up for some time (serves the same directory), but you might want to update bookmarks and the feed to <a href="http://caseywstark.com/atom.xml">http://caseywstark.com/atom.xml</a> if you use them.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Git Workflow]]></title>
    <link href="http://caseywstark.com/blog/2011/git-workflow/"/>
    <updated>2011-09-26T14:45:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/git-workflow</id>
    <content type="html"><![CDATA[<p>or &#8220;How I Learned to Stop Worrying and Love <code>git rebase -i</code>&#8221;.</p>

<p>I&#8217;ve been working with <code>git</code> in a more professional setting lately. We maintain our new cosmological code, <code>Nyx</code>, in <code>git</code> now and I can&#8217;t be as lazy as I have been with other <code>git</code> repos. We maintain 2 bare repos and about a dozen developers pull from us, so I like to be careful about what I push off.</p>

<p>Problem is, I don&#8217;t normally work that way. I like to code things quickly and try them, keeping track of changes as I go. Think &#8220;cowboy&#8221; development with very frequent commits. So, I could end up with a very messy commit history. Luckily, <code>git rebase</code> comes to the rescue.</p>

<p>So at the end of a bout of local coding, the commit history looks something like this.</p>

<p><img src="http://caseywstark.com/images/post_git/local_commits2.jpg"></p>

<p>&#8230; many commits down to &#8230;</p>

<p><img src="http://caseywstark.com/images/post_git/local_commits1.jpg"></p>

<!--more-->


<p>For many reasons, I cannot rebase commits already pushed to a remote, so I need to update the remote tracking branch at this point. A simple <code>git fetch origin master</code> does the job. Now I can rebase off this commit and rewrite my messy history.</p>

<p>I find the tip of origin/master, copy the sha, and run <code>git rebase -i [origin sha]</code>. I think there is simpler way to do this, like <code>git rebase -i origin/master</code>, but I haven&#8217;t tried it. I like to be sure I&#8217;m rebasing off the right commit for now.</p>

<p>Now, my editor opens up and shows a list of the commits since then. For each commit, I have several choices. Here&#8217;s what git displays during a rebase:</p>

<pre><code># Rebase 3272740..9ef6432 onto 3272740
#
# Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the commit message
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#  f, fixup = like "squash", but discard this commit's log message
#  x, exec = run command (the rest of the line) using shell
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
</code></pre>

<p>And here&#8217;s a snapshot of what I ended up with this time.</p>

<p><img src="http://caseywstark.com/images/post_git/git-rebase-todo.jpg"></p>

<p>So I will squash 5 commits, reword 3 of the commit messages, and leave everything else as is.</p>

<p>After saving and closing the editor, git opens each commit I want to reword or squash while rebasing. I make the changes I want, and git finishes with &#8220;Successfully rebased and updated refs/heads/master&#8221;.</p>

<p>Now my commits show up as a single line of development off of the latest commit on origin/master.</p>

<p><img src="http://caseywstark.com/images/post_git/rebased2.jpg">
<img src="http://caseywstark.com/images/post_git/rebased1.jpg"></p>

<p>Let&#8217;s just hope the non-sequential commit datetimes don&#8217;t confuse anyone.</p>

<p>Don&#8217;t forget to <code>git push origin master</code> after all that.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Pure Joy: My First Citation and a Confirmed Prediction]]></title>
    <link href="http://caseywstark.com/blog/2011/pure-joy-my-first-citation-and-a-confirmed-prediction/"/>
    <updated>2011-08-21T19:20:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/pure-joy-my-first-citation-and-a-confirmed-prediction</id>
    <content type="html"><![CDATA[<p>The first citation is a scientist&#8217;s coming of age. For the first time, you were referenced as a credible source of the edge of human knowledge.</p>

<p>Last week, my undergraduate research advisor, <a href="http://physics.usc.edu/Faculty/Kresin/">Vitaly Kresin</a>, emailed me a &#8220;nice paper&#8221;, saying &#8220;I think you might enjoy it.&#8221; He was spot on. I could barely read the abstract before I started jumping around and squealing like a little girl.</p>

<p>During my senior year at USC, Vitaly and I published theoretical results of modeling alkali metal clusters inside helium nanodroplets. We called it &#8221;<a href="http://prb.aps.org/abstract/PRB/v81/i8/e085401">Critical sizes for the submersion of alkali clusters into liquid helium</a>&#8221; and published in Physical Review B.</p>

<p>The awesome thing is that our intuition for the problem was right. We expected that small alkali clusters end up sitting in dimples on the surface of helium droplets (this was experimentally confirmed for sodium dimers and probably trimers at the time), and large clusters must sink into the center of the droplet.</p>

<p>The new paper is &#8221;<a href="http://jcp.aip.org/resource/1/jcpsa6/v135/i4/p044309_s1">The submersion of sodium clusters in helium nanodroplets: Identification of the surface → interior transition</a>&#8221; by An der Lan et al.,
in The Jounal of Chemical Physics. Here is the abstract:</p>

<!--more-->




<blockquote><p>The submersion of sodium clusters beyond a critical size in helium nanodroplets, which has recently been predicted on theoretical grounds, is demonstrated for the first time. Confirmation of a clear transition from a surface location, which occurs for alkali atoms and small clusters, to full immersion for larger clusters, is provided by identifying the threshold electron energy required to initiate Nan cluster ionization. On the basis of these measurements, a lower limit for the cluster size required for submersion, n ≥ 21, has been determined. This finding is consistent with the recent theoretical prediction.</p></blockquote>


<p>Referenced in the abstract? I couldn&#8217;t believe it! They go on to reference me and Prof. Kresin and our results for the critical submersion size of sodium clusters. The experiment demonstrates &#8220;excellent agreement&#8221; with our prediction for sodium.</p>

<p>In the grand scheme of science, this is not exactly earth-shattering &#8211; this is like a tiny screw in the giant tower of human knowledge. I doubt anyone besides Vitaly and I will sleep more soundly knowing this. But it&#8217;s <strong>my</strong> tiny screw and I&#8217;m proud of it. And I&#8217;m so glad that I had the opportunity to do some good theory work with a brilliant advisor.</p>

<p>If you care to read on, here are some other goodies from An der Lan et al.:</p>

<p>&#8220;Thus, at some critical size the cluster may become submerged in the helium rather than adopt a surface location. Recently, Stark and Kresin have described and employed a theoretical model which anticipates such a critical cluster size for alkali submersion<sup>9.</sup> For example, Na_n clusters are predicted to preferentially enter ^4 He nanodroplets once n ≥ 21, whereas K_n clusters require approximately 78 atoms to become fully solvated.&#8221;</p>

<p>&#8220;The ion yield curves for Na<sup>19+</sup> and smaller clusters are consistent with a surface location for the corresponding neutral clusters, whereas those for Na<sup>21+</sup> and larger clusters are consistent with an interior location for the corresponding neutral clusters. These findings provide strong evidence for a switch from a surface location to an interior location at a certain sodium cluster size. For completeness, we show aggregated data for the much weaker even cluster ions in Figure 5, where the signal from all Na<sup>n+</sup> ions with n > 20 have been summed together and similarly all of those with n ≤ 20. Again this is consistent with a change in cluster location at around the n = 20 or 21 size.&#8221;</p>

<p>&#8220;Thus, because of the potential for ion fragmentation, we can only firmly establish a lower limit of n ≥ 21 for sodium cluster submersion in ^4 He droplets. The lower limit is in excellent agreement with a recent theoretical prediction made by Stark and Kresin, whose model suggested that the minimum Nan cluster size for submersion in ^4 He droplets occurred at n = 21<sup>9.</sup></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Grep Tip]]></title>
    <link href="http://caseywstark.com/blog/2011/grep-tip/"/>
    <updated>2011-08-07T10:11:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/grep-tip</id>
    <content type="html"><![CDATA[<p>I noticed that I&#8217;ve been using <code>grep</code> a lot lately to search for text in a
directory. I find myself using the same options every time as well:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="nv">$ </span>grep --color -irn <span class="s2">&quot;some text&quot;</span> .
</span></code></pre></td></tr></table></div></figure>


<p>Just to be clear, <code>--color</code> highlights the search string in the output, <code>-i</code>
makes the search case-insensitive, <code>-r</code> makes the search recursive, <code>-n</code>
outputs the line number of the hit, and the <code>.</code> at the end says to search the
current directory. Lazy as I am, I realized I could just add this to
<code>~/.bash_profile</code>:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="nb">alias </span><span class="nv">ggrep</span><span class="o">=</span><span class="s2">&quot;grep --color -irn&quot;</span>
</span></code></pre></td></tr></table></div></figure>


<p>Now, I can save some time and thought with <code>ggrep "thing" .</code> It&#8217;s the little
things&#8230;</p>

<p><strong>EDIT</strong>: As <a href="https://sites.google.com/site/matthewturk/">Matt Turk</a> suggests in
the comments, the best alternative (especially for the Pythonists) is <code>grin</code>.
Much simpler and clearer display of results.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Update at SF11 Cosmology]]></title>
    <link href="http://caseywstark.com/blog/2011/update-at-sf11-cosmology/"/>
    <updated>2011-07-14T12:00:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/update-at-sf11-cosmology</id>
    <content type="html"><![CDATA[<p>I am currently participating in
<a href="http://www.lanl.gov/projects/cosmology/sf11/">SF11 Cosmology</a> at St. John&#8217;s
College in Sante Fe, NM. I am here for weeks 2 and 3, so I&#8217;ll be back in
Berkeley on July 23rd.</p>

<p>It&#8217;s been a great couple of days, meeting lots of fellow cosmologists, having
very casual talks and schedule, and nerding out. I have been taking lots of
notes, but I decided that I should keep them private, at least for now. I know
that&#8217;s not being my usually open self, but it would take too much time to clean
them up for all eyes. If you would like to know anything about what&#8217;s going on,
feel free to contact me though.</p>

<p>Just another note: there is very little AT&amp;T reception in Sante Fe and even less
at the College, so please email me if you need to get in touch.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Your File System's Love Life]]></title>
    <link href="http://caseywstark.com/blog/2011/your-file-systems-love-life/"/>
    <updated>2011-06-21T12:00:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/your-file-systems-love-life</id>
    <content type="html"><![CDATA[<p><a href="http://www.brendangregg.com/Specials/lsss">lsss - ls with StarSign</a></p>

<pre><code>$ lsss /etc/default
total 49
-r-xr-xr-x   1 root           12     gemini Jun  4  2002 cron
-r--r--r--   1 root          204     gemini Jun  4  2002 devfsadm
-r--r--r--   1 root         3388     gemini Jun  4  2002 dhcpagent
-r--r--r--   1 root           10     gemini Jun  4  2002 fs
-r--r--r--   1 root          719   aquarius Jan 23  2004 inetd
-r--r--r--   1 root          379     gemini Jun  4  2002 inetinit
-r-xr-xr-x   1 root          638     gemini Jun  4  2002 init
-r--r--r--   1 root         1182      virgo Sep 15  2002 kbd
[...]
</code></pre>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Twinkle Twinkle]]></title>
    <link href="http://caseywstark.com/blog/2011/twinkle-twinkle/"/>
    <updated>2011-06-20T12:00:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/twinkle-twinkle</id>
    <content type="html"><![CDATA[<blockquote><p>Twinkle twinkle little star<br/>How I wonder what you are<br/>When my civilization advances<br/>And we can fly to your galaxy<br/>We&#8217;ll exploit your natural resources</p><footer><strong>Miles Guidon</strong> <cite>Facebook</cite></footer></blockquote>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Note to Self About Python Graphics]]></title>
    <link href="http://caseywstark.com/blog/2011/note-to-self-about-python-graphics/"/>
    <updated>2011-05-22T12:00:00-07:00</updated>
    <id>http://caseywstark.com/blog/2011/note-to-self-about-python-graphics</id>
    <content type="html"><![CDATA[<p>On a Mac (and possibly other systems), <strong>do not install the 64-bit version of
EPD</strong>. Only install the 32-bit if you want your graphics to work.</p>

<p>This is a bug that has to do with the Mac framework architecture. Basically, you
need to install matplotlib to <code>/Library/Frameworks/Python.framework/</code> or
matplotlib will not be able to interact with the Mac OS X Windows Manager
properly. I don&#8217;t know the first thing about window managers, but I can tell you
that this is really important when you want to save your figures.</p>

<p>I tried many things, including installing numpy, scipy, and matplotlib in a
virtualenv. I thought it would be much cleaner to &#8220;activate&#8221; my scientific
environment, keeping the Apple Python build as my system default. I got this all
setup and when I tried to use matplotlib, I could not type in the textfield in
the matplotlib save figure window. That is, I would plot something, click save,
and then I could not enter a filename in the dialogue box. Infuriating.</p>

<p>So I gave up and installed the EPD 32-bit academic version. Not ideal, but it
works really well and it just means my environment variables are a tiny bit
mangled. No bigs.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Paper Hustler Going Beta]]></title>
    <link href="http://caseywstark.com/blog/2011/paper-hustler-going-beta/"/>
    <updated>2011-02-26T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2011/paper-hustler-going-beta</id>
    <content type="html"><![CDATA[<p>That&#8217;s right, folks.</p>

<p>I am making a web editor for scientists, called <em>Paper Hustler</em>. I just put up
the pre-beta site at <a href="http://paperhustler.com">http://paperhustler.com</a>. You can
also follow @<a href="http://twitter.com/paperhustler/">paperhustler</a>.</p>

<p>I put up the site yesterday, just before giving my talk at the Grad Student
Postdoc Seminar (aka Wine And Cheese Talks). You can check out
<a href="http://www.slideshare.net/caseywstark/put-some-hustle-in-your-papers">the slides</a>
to see a quick pitch (my thoughts that inspired the project) and new forms of
scientific dissemination.</p>

<div style="width:595px" id="__ss_7074749">
  <strong style="display:block;margin:12px 0 4px">
    <a href="http://www.slideshare.net/caseywstark/put-some-hustle-in-your-papers" title="Put Some Hustle In Your Papers">Put Some Hustle In Your Papers</a>
  </strong>
  <object id="__sse7074749" width="595" height="497">
    <param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=paperspublic-110226182647-phpapp02&stripped_title=put-some-hustle-in-your-papers&userName=caseywstark" />
    <param name="allowFullScreen" value="true"/> <param name="allowScriptAccess" value="always"/>
    <embed name="__sse7074749" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=paperspublic-110226182647-phpapp02&stripped_title=put-some-hustle-in-your-papers&userName=caseywstark" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="595" height="497">
    </embed>
  </object>
  <div style="padding:5px 0 12px">
    View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/caseywstark">caseywstark</a>
  </div>
</div>


<p>I am looking for lots of feedback on this, so please let me know what you think,
good or bad.</p>

<p>In the future, I hope to post details on the tech behind the project. I have
<strong>really</strong> enjoyed <del>obsessing over</del> developing this one.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Dear Scientists, Open Science Means More Than Open Publishing]]></title>
    <link href="http://caseywstark.com/blog/2011/dear-scientists-open-science-means-more-than-open-publishing/"/>
    <updated>2011-01-11T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2011/dear-scientists-open-science-means-more-than-open-publishing</id>
    <content type="html"><![CDATA[<p><em>Published June 14, 2010 on the CoLab blog, by Casey W. Stark.</em></p>

<p>In the past few years, Open Science has become quite the buzz word, but most
people aren&#8217;t sure exactly what it means. Since DJ and I will be discussing it a
lot in the upcoming weeks, I would like to nail down a definition.</p>

<p>When people think open science, they think open access. That is, publishing your
papers to a journal without a paywall. That&#8217;s a good start, but we would like to
think it encompasses more than that. A lot more.</p>

<h1>What Open Means For Science</h1>

<p>First off, when we think open publishing, we mean open publishing of
<strong>everything</strong>. That means more than the paper -– it means the raw data, the
analyzed data, and any code involved along with the final paper. Sure, there are
a lot of technicalities with publishing data (so many we can&#8217;t discuss it here),
but you should at least publish the data included in the paper to make your
colleagues&#8217; lives easier.</p>

<p>Second, truly open science means also <strong>doing</strong> science openly. That&#8217;s right,
I&#8217;m talking full on scientific transparency. When it comes down to it, we need
to improve how science is done, not just the way it is distributed. When I say
open science, this is mostly what I&#8217;m referring to –- the practice of putting
all works in progress on the web.</p>

<p>So let&#8217;s talk about what this new openness buys us and why it should become the
new norm.</p>

<!--more-->


<h1>How Open Benefits Science</h1>

<p>The most common argument for open access is to give the taxpayer what they paid
for. It&#8217;s not easy to motivate scientists with this one, but there are many good
reasons for it, which you should read about
<a href="http://3quarksdaily.blogs.com/3quarksdaily/2006/10/the_future_of_s_1.html">here</a>.
But open science also means doing science in public channels, which has plenty
of its own benefits.</p>

<h2>Timestamped records</h2>

<p>For starters, we get a public record of everything we do. Every single one of
our contributions is timestamped and publicly accessible. Skeptics of doing
science in the open usually argue that making our works in progress public will
open them up to getting scooped, but to us, it seems much more likely that this
will prevent it. If you have an accredited, timestamped record of your idea, how
are you going to get scooped? If someone stumbles upon your idea and wants to
work on it, they are more likely to contact and bam, you have another
collaborator.</p>

<h2>Disrupting the scientific group</h2>

<p>One of the biggest changes open science could have in store is shaking up the
model of the scientific group. Instead of working in a fixed group of people,
open science would allow us to focus on the the problems themselves, with
individual scientists contributing solutions as they please. Not saying that the
scientific group will be destroyed or should go away, but groups would certainly
be more flexible this way.</p>

<p>Currently, secrecy is the glue holding the scientific group together. But if we
share our day-to-day research beyond the same fixed group of collaborators, the
sacred bond will be broken and scientists will be able to mix it up with other
collaborators more often. At the very least scientists can collaborate more
frequently based on expertise and background instead of whoever is down the
hall.</p>

<h2>Publicizing works that were previously lost to the void</h2>

<p>As I said
<a href="http://thestarkeffect.com/blog/2011/archive-dear-scientists-stop-duplicating-work/">last week</a>,
transparency in science will help eliminate duplicate efforts. This includes
things like research mistakes that led to dead ends and half-finished projects.
If we make works in progress public, others can learn from our mistakes and help
pick up the projects we never had time for.</p>

<h2>Awesome metrics of impact</h2>

<p>Currently, measuring scientific impact is very difficult and our methods for
trying to figure it out (basically just bibliometrics) are horribly crude. Being
scientists, you would think we would be a little more interested in this, but
maybe we haven&#8217;t done anything about it because our current scientific model
gives us practically no data. With truly open science, we could have so much
data that we wouldn&#8217;t know what to do with it. At the very least, open science
on the web would unlock the potential for all sorts of scientific metrics.</p>

<h2>Exposure of the scientific method</h2>

<p>No, I&#8217;m not talking about the thing you learned in second grade. This new
practice would provide excellent exposure of the scientific method –- the way it
really works -– raw, uncut, and in the wild.</p>

<p>I’ve been studying physics for four years now and I think I still don&#8217;t have a
clear idea of how the field <strong>actually</strong> evolves. Having a working record of
scientific projects would provide anyone interested (scientists in other fields,
students, and enthusiasts) with a level of intimacy with research projects that
was previously impossible. It&#8217;s no replacement for real research experience, but
full transparency would definitely provide a better idea of the scientific
method than we can get now.</p>

<h1>How Open Can Science Be?</h1>

<p>Many scientists will think that open science is too risky for some time, but we
can all tell it&#8217;s heading there and as we&#8217;ve said, someone needs to start it. As
more and more scientists pick up their web developer hats and web science
becomes more respected, I believe we will see a reinventing of how we establish
scientific credit and this will really determine exactly how far (and how fast)
this open model can go.</p>

<p>The dream is for scientists not to worry about their own research and funding so
much and to remember that it&#8217;s all about the science.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Dear Scientists, The Future Scientific CV Is A Live Feed]]></title>
    <link href="http://caseywstark.com/blog/2011/dear-scientists-the-future-scientific-cv-is-a-live-feed/"/>
    <updated>2011-01-10T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2011/dear-scientists-the-future-scientific-cv-is-a-live-feed</id>
    <content type="html"><![CDATA[<p><em>Published on the CoLab blog, written by <a href="http://djstrouse.com/">DJ Strouse</a>.</em></p>

<p>In the past decade or so, establishing a personal webpage has just about become
a requirement in science. Try to Google the name of the nice waiter or waitress
you met at dinner today and you&#8217;re likely to come up empty-handed. But the new
colleague you met at a conference this morning? You&#8217;d probably be shocked if a
Google search didn&#8217;t turn up a homepage or at the very least a university or
research institution profile listing research interests and other personal
information. Scientists have realized long before the majority of human beings
the great social benefits of establishing an online persona to manage their
public image and encourage new collaborations.</p>

<p>Smart move.</p>

<p>Scientists now have the opportunity to lead the pack on another intriguing
technology on the horizon relating to managing one’s own public image –- the CV
as a live digital stream of professional contributions.</p>

<!--more-->


<h1>The CV as a Live Feed</h1>

<p>First of all, what do I mean by &#8220;live digital stream of professional
contributions&#8221;?</p>

<p>Up until now, the CV has been a collection of lightly edited PDFs buried in a
folder somewhere on your desktop. You probably scramble to update it only when
you&#8217;re applying for a new position or grant, wasting hours wracking your brain
to recall every publication, peer review, or other contribution you&#8217;ve made
recently and yet still forgetting several important pieces of data.</p>

<p>Yet plenty of that information you cram into your CV is either already available
online or soon will be as science becomes more open. Why painstakingly curate it
yourself? Imagine a service that aggregates your most recent publications,
counts the number of papers you peer review, keeps track of the conferences you
attend, and presents your collective scientific contribution in a live stream,
just like an RSS feed.</p>

<p>The future of the scientific CV is a live digital stream of your scientific
contributions.</p>

<p>Now why should you be excited?</p>

<h2>Save Time</h2>

<p>I&#8217;ve never met a scientist who would rather be updating their CV than thinking
about interesting problems. Any change that allows scientists to focus more on
thinking, experimenting, and collaborating and less time on administrative tasks
should be an easy sell.</p>

<h2>Never Forget to Include Your Latest Updates</h2>

<p>Trying to remember accepted and pending submissions for half a dozen journals,
the number of times you stayed up half the night peer reviewing a paper, or the
collection of awards you picked up for your latest hit paper isn&#8217;t easy. And if
you forget to list something, don&#8217;t expect a committee to go digging up all your
missing data. Unlisted by you = unappreciated by them. Aggregation is what
machines are good at it. Leave it to them.</p>

<h2>Easy Customization -– For Both Scientists and Their Employers</h2>

<p>Rather than painstakingly reviewing and revising every item on your CV each time
you want to share it with someone, simply check a few boxes, applying custom
filters that determine exactly which information they&#8217;ll gain access to. And
don&#8217;t feel pressured to whittle your CV down to as few pages as possible. If
application committees have their own set of filters, they can easily hone in on
what they&#8217;re interested in. Giving both parties filtering capabilities, only
information of mutual interest gets reviewed.</p>

<h2>Accreditation</h2>

<p>Now imagine you&#8217;re on an application committee. In principle, you could always
exhaustively verify the claims made on each CV you review, but let&#8217;s be
realistic. It&#8217;s unlikely you&#8217;ll even <em>read</em> all the CVs you receive, let alone
<em>verify</em> them. Instead, you simply take on blind faith the lengthly list of
publications offered to you.</p>

<p>But what if journals published accredited feeds, detailing every author&#8217;s
contribution in a way that was easily integrated into a digital CV? Better yet,
what if they also published the number of papers that an author peer reviewed,
conference organizers published easily aggregated lists of attendees and
speakers, and universities provided verified lists of courses taught, seminars
given, and other academic contributions? A CV would no longer be a holy document
accepted on blind faith; it would be an aggregation of information verified by
the greater scientific community.</p>

<h2>A Richer Measure of Scientific Impact</h2>

<p>The most interesting benefits of the CV as a live feed, however, come as
scientific communication migrates online and becomes more public. Instead of
&#8220;peer viewed papers for journal X&#8221;, CVs could include the <em>number</em> of papers
peer-reviewed and the <em>quality of feedback</em> as measured by the votes of authors
or, in the case of open peer review, the votes of the community as well. Instead
of &#8220;published paper in journal Y&#8221;, CVs could include the <em>quality of the
publication</em> as measured by votes from the community, instead of something as
crude as a citation index.</p>

<p><em>Black-box descriptions of scientific contributions could become much richer
measures of how the greater community values a researcher’s work.</em></p>

<p>Data on scientific communication could also help the community to distinguish
hermits from those who actively contribute to other&#8217;s work, even if it doesn&#8217;t
mean a co-authorship. While many valuable contributions to science are made in
solitude, useful feedback is also key to the scientific process and is
surprisingly absent from present measures of scientific output. The idea isn&#8217;t
to penalize hermits but simply to reward those who do make an effort to
contribute to the greater scientific effort.</p>

<p>Blog posts, popular science articles, publicly posted lectures, and other forms
of public outreach could also be easily included.</p>

<p>Some of the tools to do this are already available, but many are not. Scientists
should be first in line in both demanding <em>and</em> developing them.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Dear Scientists, Stop Duplicating Work]]></title>
    <link href="http://caseywstark.com/blog/2011/dear-scientists-stop-duplicating-work/"/>
    <updated>2011-01-10T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2011/dear-scientists-stop-duplicating-work</id>
    <content type="html"><![CDATA[<p><em>Published June 13, 2010 on the CoLab blog, by
<a href="http://djstrouse.com/">DJ Strouse</a>.</em></p>

<p>Making Open Science the standard is a much greater task than just building the
best tools for it. Most of the battle in fact, is just motivating scientists to
work and think in a new way.</p>

<p>As <a href="http://thestarkeffect.com/blog/2011/archive-dear-scientists-road-open-science-paved-tr/">DJ says</a>,
figuring out the best way to do open science may take some wasted effort, but
once we have that settled, we could get even more time back by saving scientists
from duplicating other scientists&#8217; work.</p>

<p>If you&#8217;re confused about what I mean, here are a few examples:</p>

<!--more-->


<h1>Duplicate Code</h1>

<p>Albert wrote a simple stellar simulation program for his latest paper. Barbara
is another astrophysicist who wants to use this program with slightly different
parameters. Unfortunately, Albert only wrote about the code in his paper and
never released it. When Barbara tries to contact Albert, he never responds.</p>

<p>It&#8217;s a common situation. Many scientists write code that never gets seen by the
rest of the world. Maybe someone in their group looks over it, but usually,
that&#8217;s the furthest it goes.</p>

<p>Whatever the reason, many scientists end up having to rewrite code that&#8217;s
already out there. This is a problem for many reasons, but one of the biggest
issues is that no one gets to save time by reusing their code. Every time
someone has a need for similar computations, they have to spend a significant
amount of time writing and testing (and hopefully documenting) their own
version.</p>

<p>Sure, there are many reasons to create your own version of someone else&#8217;s code
-– you might want to get more familiar with the calculations (or double check
them), rewrite it in a more familiar language, or clean it up to make future
improvements easier to implement. However, all of this becomes much, much easier
when you have a working copy in front of you.</p>

<p>So let&#8217;s make code open. There are many other scientific reasons for releasing
code, but at the very least, we should do it to make it easier on our fellow
scientists.</p>

<h1>Duplicate Searching/Aggregating</h1>

<p>A lot of scientific work involves figuring out what people have already figured
out. Searching for papers, reading them, and repeating takes a lot of time. More
importantly, everyone in the same field does the same (or very similar)
searching, reading, and organizing. If we could record and share our work in
this arena, we would save a lot of time and needless effort.</p>

<p>If Carol spends all day searching around for seminal quantum computation papers
and organizing them, why should Daniel spend all of tomorrow doing the same
thing? Sure, he still has to read the papers, but he could save a good chunk of
his day by having these papers already organized, rated, and reviewed for him.</p>

<p>Luckily, this one is already being tackled by the folks over at
<a href="http://www.mendeley.com/">Mendeley</a>. Hands down, Mendeley is the best way to
organize papers and share them. The Mendeley research network also allows you to
use other users&#8217; tags and reading stats to find papers in your field more
efficiently.</p>

<h1>Duplicate Mistakes</h1>

<p>Scientists make only a tiny percentage of their work public because we only
publish the most polished version of the final results. We have very few records
of all of the mistakes we make along the way, which are bound to be forgotten
soon after.</p>

<p>Remember that brilliant idea you wanted to try after reading that paper the
other day? That idea you thought was brand new because you couldn&#8217;t find
anything after a quick literature search? Perhaps several people did try the
same thing, only to get stuck and realize it was a doomed approach. If these
blunders, dead ends, and half-way solutions were made public, we could learn
from them instead of repeating the same mistakes.</p>

<h1>Duplicate Projects</h1>

<p>Of course, the worst kind of duplicate work is repeating entire projects.</p>

<p>One of the biggest advantages to open science is that you can always see what
your fellow researchers are up to. The current model of the scientific groups
makes the bulk of their ongoing work invisible. Instead of constantly competing
with similar groups or worrying about getting scooped out of nowhere, we could
finally combine efforts and focus on the questions themselves, not whose side
we&#8217;re on.</p>

<h1>Get Started Sharing</h1>

<p>So say you want to start participating in open science today. Here are some
great starting points:</p>

<ul>
<li><a href="http://www.myexperiment.org">myExperiment</a> for sharing experimental
workflows and data.</li>
<li><a href="http://github.com">GitHub</a> for hosting code and collaborating with other
coders.</li>
<li><a href="http://delicious.com">Delicious</a> for sharing and organizing anything on the
web (bookmarking).</li>
<li><a href="http://www.mendeley.com">Mendeley</a> for finding, organzing, and recommending
papers.</li>
<li><a href="http://twitter.com]%20or%20[FriendFeed](http://friendfeed.com">Twitter</a> for
getting and receiving quick updates about projects.</li>
<li><a href="http://colabscience.com">CoLab</a> for organizing collaborations around a single
question.</li>
</ul>


<p>No more hoarding code, mistakes, ideas, and published data. Saving your
colleagues hours of toil and frustration is just a few clicks away -– all it
means is sharing your work.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Dear Scientists, The Road To Open Science Is Paved With Trial And Error]]></title>
    <link href="http://caseywstark.com/blog/2011/dear-scientists-the-road-to-open-science-is-paved-with-trial-and-error/"/>
    <updated>2011-01-06T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2011/dear-scientists-the-road-to-open-science-is-paved-with-trial-and-error</id>
    <content type="html"><![CDATA[<p><em>Published June 6, 2010 on the CoLab blog, by
<a href="http://djstrouse.com">DJ Strouse</a>.</em></p>

<p>There will be no perfect tool for open science.</p>

<p>Blogs like that of <a href="http://michaelnielsen.org/blog/">Michael Nielsen</a> and
<a href="http://cameronneylon.net/category/blog/">Cameron Neylon</a>, the
<a href="http://www.sciencebase.com/science-blog/100-scientific-twitter-friends">Twitterverse</a>
and the <a href="http://friendfeed.com/science-2-0">Science 2.0 group</a> over at
FriendFeed are full of comments from people eager to participate in open
science. Many dream of a wonderful future in which
<a href="http://michaelnielsen.org/blog/scientific-communication/">papers are full of links and dynamic data and tailored to the readers&#8217; needs</a>,
<a href="http://michaelnielsen.org/blog/is-scientific-publishing-about-to-be-disrupted/">publishing is fast, open, and free</a>,
and <a href="http://blog.openwetware.org/scienceintheopen/2009/06/08/google-wave-in-research-part-ii-the-lab-record/">experimental data is uploaded directly and automatically from the lab bench to the web</a>.
Yet many giddy comments end with a whimpering &#8220;Let me know when something like
this is available.&#8221; Plenty of people are interested in doing open science, but
everyone is waiting for the perfect tool.</p>

<p>Well folks, its not coming anytime soon. It&#8217;s not for lack of demand or
interest. <em>It&#8217;s that we still don’t know what the perfect tools for open science
look like.</em></p>

<!--more-->


<p>The problem is that very few people are actually <em>experimenting</em> with open
science. There are great discussions going on (especially at the sites I
mentioned above), proposing lots of interesting ideas about how to do open
science, but discussion alone is not going to separate the good ideas from the
bad. We&#8217;re currently theorizing blindly. Just as theorists are lost without
experimentalists, so too are brainstorms without trial and error.</p>

<p><em>We need to be willing to waste our time with imperfect tools.</em></p>

<p><a href="http://wordpress.com">Wordpress blogs</a>, wikis, and Twitter were neither
designed for scientists nor are they great tools for doing open science.
<a href="http://www.myexperiment.org">MyExperiment</a>, <a href="http://www.naboj.com">Naboj</a>, and
<a href="http://colabscience.com">CoLab</a> were actually designed for doing open science,
but they certainly aren&#8217;t perfect. However, all of these tools do provide
sandboxes where those of us interested in doing open science can start to get
our hands dirty. By experimenting with imperfect tools (and being willing to
&#8220;waste&#8221; a little time), we can better understand exactly what features killer
open science apps must have. And along the way, we will have actually <em>done</em>
some open science.</p>

<p>Consider the <a href="http://polymathprojects.org">PolyMath Projects</a>. Certainly blog
comments are not the perfect place to do collaborative mathematics. Yet lack of
equation support, poor filtering, and the inability to branch conversations
didn&#8217;t stop 30+ mathematicians from doing genuinely new and important
mathematics on the web.</p>

<p>So start a blog about your ongoing research projects. Tweet questions for
colleagues or links to interesting new papers. Post data and code to your
homepage. <em>Do</em> something, even if it&#8217;s not the perfect thing you envisioned open
science to be.</p>

<p>This post is not proposing any ground-breaking ideas. It is only meant to stress
the importance of experimentation in a field that should know better.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Underscore.js Template Error]]></title>
    <link href="http://caseywstark.com/blog/2010/underscore-js-template-error/"/>
    <updated>2010-12-29T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2010/underscore-js-template-error</id>
    <content type="html"><![CDATA[<p>I just started using <a href="http://documentcloud.github.com/backbone/">Backbone.js</a> and <a href="http://documentcloud.github.com/underscore/">Underscore.js</a> for my latest work. They are a godsend for cranking out lightweight JavaScript apps.</p>

<p>The problem I always have with JavaScript is debugging. I don&#8217;t have a whole lot of experience with JavaScript, so that might be a big part of the problem, but the errors usually aren&#8217;t very helpful, and plain impossible if the culprit code is minified. I&#8217;m just lucky that the Chrome developer panel is there.</p>

<p>I was trying to compile a JavaScript template using Underscore&#8217;s <a href="http://documentcloud.github.com/underscore/#template">template</a> function, but I kept getting an unexpected identifier error that pointed to the line calling <code>_.template($("#template_id").html())</code> somewhere in Chrome&#8217;s traceback.</p>

<p>I was afraid this was a compatibility issue between the versions of Underscore.js and jQuery. Wrong. After juggling versions for a while, I looked at my template again:</p>

<pre><code>&lt;span class="authors-count"&gt;&lt;% authors %&gt;&lt;/span&gt; authors.
</code></pre>

<p>So kids, always remember to start your template tags with <code>&lt;%**=**</code>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Inline Editing With Django]]></title>
    <link href="http://caseywstark.com/blog/2010/inline-editing-with-django/"/>
    <updated>2010-12-25T12:00:00-08:00</updated>
    <id>http://caseywstark.com/blog/2010/inline-editing-with-django</id>
    <content type="html"><![CDATA[<p>I need inline editing for my current project. I couldn&#8217;t find any one solid solution, so I decided to hack together my own.</p>

<p><a href="http://www.dajaxproject.com/">Dajax</a> has an excellent example of this. See their <a href="http://www.dajaxproject.com/flickr">flickr-style editor demo</a>, especially if you aren&#8217;t sure what I mean by inline editing.</p>

<p>I wanted to do something very similar on the frontend, but I think that in most cases, Dajax&#8217;s philosophy just gets in the way. It&#8217;s a nice way to keep as much of the code as possible in Django, but as a web developer, you should be completely comfortable with JavaScript anyway. In the end, Dajax is a middleman and I don&#8217;t like those.</p>

<p>So I went out and looked for a sweet jquery plugin and found <a href="http://www.appelsiini.net/projects/jeditable">jeditable</a>. The short review &#8211; it&#8217;s great.</p>

<!--more-->


<p>Assuming you setup your fields something like&#8230;</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;.editable&#39;</span><span class="p">).</span><span class="nx">editable</span><span class="p">(</span><span class="s1">&#39;{% url update_url_name %}&#39;</span><span class="p">,</span> <span class="p">{</span>
</span><span class='line'>    <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;text&#39;</span><span class="p">,</span>
</span><span class='line'>    <span class="nx">id</span><span class="o">:</span> <span class="s1">&#39;field&#39;</span><span class="p">,</span>
</span><span class='line'>    <span class="nx">name</span><span class="o">:</span> <span class="s1">&#39;value&#39;</span><span class="p">,</span>
</span><span class='line'>    <span class="nx">submit</span><span class="o">:</span> <span class="s1">&#39;save&#39;</span><span class="p">,</span>
</span><span class='line'>    <span class="nx">cancel</span><span class="o">:</span> <span class="s1">&#39;cancel&#39;</span>
</span><span class='line'><span class="p">});</span>
</span></code></pre></td></tr></table></div></figure>


<p>Just write a django view to save the field updates and you&#8217;re good to go.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="o">...</span> <span class="n">get</span> <span class="n">the</span> <span class="n">thing</span> <span class="n">containing</span> <span class="n">the</span> <span class="n">field</span> <span class="n">to</span> <span class="n">update</span> <span class="o">...</span>
</span><span class='line'><span class="n">field</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">POST</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;field&quot;</span><span class="p">,</span> <span class="n">field</span><span class="p">)</span>
</span><span class='line'><span class="n">value</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">POST</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;value&quot;</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
</span><span class='line'><span class="o">...</span> <span class="n">validate</span> <span class="n">the</span> <span class="n">update</span> <span class="n">value</span> <span class="ow">and</span> <span class="n">check</span> <span class="n">permissions</span> <span class="o">...</span>
</span><span class='line'><span class="nb">setattr</span><span class="p">(</span><span class="n">thing_object</span><span class="p">,</span> <span class="n">field</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
</span><span class='line'><span class="n">paper</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
</span></code></pre></td></tr></table></div></figure>


<p>BAM. More details to come.</p>

<p>Merry Christmas everyone!</p>
]]></content>
  </entry>
  
</feed>

