<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Daniel Nouri's Blog</title>
    <link>http://danielnouri.org/notes</link>
    <description>Adventures in hi-py</description>
    <pubDate>Wed, 19 Dec 2012 22:48:08 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>libblas and liblapack issues and speed, with SciPy and Ubuntu</title>
      <link>http://danielnouri.org/notes/2012/12/19/libblas-and-liblapack-issues-and-speed,-with-scipy-and-ubuntu</link>
      <pubDate>Wed, 19 Dec 2012 23:30:00 CET</pubDate>
      <category><![CDATA[Python]]></category>
      <category><![CDATA[Programming]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/12/19/libblas-and-liblapack-issues-and-speed,-with-scipy-and-ubuntu</guid>
      <description>libblas and liblapack issues and speed, with SciPy and Ubuntu</description>
      <content:encoded><![CDATA[<div class="document">
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#the-problem" id="id1">The problem</a></li>
<li><a class="reference internal" href="#to-fix-it" id="id2">To fix it</a></li>
<li><a class="reference internal" href="#more-information" id="id3">More information</a></li>
<li><a class="reference internal" href="#speed-it-up-build-an-optimized-atlas-for-your-architecture" id="id4">Speed it up!  Build an optimized Atlas for your architecture.</a></li>
</ul>
</div>
<div class="section" id="the-problem">
<h3><a class="toc-backref" href="#id1">The problem</a></h3>
<p>You've built from source a package that uses the linear algebra
libraries BLAS and LAPACK, but now you're getting:</p>


<div class="pygments_murphy"><pre>libatlas.so.3: cannot open shared object file: No such file or directory
</pre></div>



<p>In my case, I was trying to install <a class="reference external" href="http://www.scipy.org/">SciPy</a>
from source using <tt class="docutils literal">pip install scipy</tt>, but then ran into this issue
when I tried to use it.  I also ran into this other problem:</p>


<div class="pygments_murphy"><pre>ImportError: scipy/linalg/clapack.so: undefined symbol: clapack_sgesv
</pre></div>



</div>
<div class="section" id="to-fix-it">
<h3><a class="toc-backref" href="#id2">To fix it</a></h3>
<ol class="arabic">
<li><p class="first">Make sure you've got <tt class="docutils literal"><span class="pre">libatlas3-base</span></tt> installed:</p>


<div class="pygments_murphy"><pre>sudo apt-get install libatlas3-base
</pre></div>



</li>
<li><p class="first">Make sure you're using the right implementation of
<tt class="docutils literal">libblas.so.3</tt>, that is, the one that <tt class="docutils literal"><span class="pre">libatlas3-base</span></tt>
provides.  This implementation lives in
<tt class="docutils literal"><span class="pre">/usr/lib/atlas-base/atlas/libblas.so.3</span></tt>.</p>
<p>To do this, run the following command to set your system's default
Atlas implementation:</p>


<div class="pygments_murphy"><pre>sudo update-alternatives --config libblas.so.3
</pre></div>



<p>An example of what this might produce, and what number you might
need to enter:</p>


<div class="pygments_murphy"><pre>Selection      Path                                     Priority   Status
------------------------------------------------------------
* 0            /usr/lib/openblas-base/libopenblas.so.0   40        auto mode
  1            /usr/lib/atlas-base/atlas/libblas.so.3    35        manual mode
  2            /usr/lib/libblas/libblas.so.3             10        manual mode
  3            /usr/lib/openblas-base/libopenblas.so.0   40        manual mode

 Press enter to keep the current choice[*], or type selection number: 1
</pre></div>



</li>
<li><p class="first">Use <tt class="docutils literal">liblapack3.so.3</tt> from
<tt class="docutils literal"><span class="pre">/usr/lib/atlas-base/atlas/liblapack.so.3</span></tt> as your default:</p>


<div class="pygments_murphy"><pre>sudo update-alternatives --config liblapack.so.3
</pre></div>



</li>
</ol>
<p>That's it.  Now you shouldn't be getting the aforementioned errors
anymore.</p>
</div>
<div class="section" id="more-information">
<h3><a class="toc-backref" href="#id3">More information</a></h3>
<p>The Debian Wiki has an <a class="reference external" href="http://wiki.debian.org/DebianScience/LinearAlgebraLibraries">overview of linear algebra libraries available</a>, and
it also describes how to use <tt class="docutils literal"><span class="pre">update-alternatives</span></tt> to switch between
BLAS and LAPACK implementations.</p>
</div>
<div class="section" id="speed-it-up-build-an-optimized-atlas-for-your-architecture">
<h3><a class="toc-backref" href="#id4">Speed it up!  Build an optimized Atlas for your architecture.</a></h3>
<p>The <tt class="docutils literal">README.Debian</tt> file of <tt class="docutils literal"><span class="pre">libatlas3-base</span></tt> explains:</p>
<blockquote>
<p>Building your own optimized packages of Atlas is straightforward.
Just get the sources of the package and its build-dependencies:</p>


<div class="pygments_murphy"><pre># apt-get source atlas
# apt-get build-dep atlas
# apt-get install devscripts
</pre></div>



<p>and type the following from the atlas source subdir:</p>


<div class="pygments_murphy"><pre># fakeroot debian/rules custom
</pre></div>



<p>it should produce a package called:</p>


<div class="pygments_murphy"><pre>../libatlas3-base_*.deb
</pre></div>



<p>which is optimized for the architecture Atlas has been built
on. Then install the package using <tt class="docutils literal">dpkg <span class="pre">-i</span></tt>.</p>
</blockquote>
<p>If you, like me, get this &quot;classical&quot; error when building Atlas:</p>


<div class="pygments_murphy"><pre>VARIATION EXCEEDS TOLERENCE, RERUN WITH HIGHER REPS
</pre></div>



<p>then you'll need to read this: <a class="reference external" href="http://math-atlas.sourceforge.net/errata.html#tol">Your install dies with &quot;unable to get
timings in tolerance&quot;</a>.</p>
<p>Lastly, you might need to remove any existing <tt class="docutils literal">libopenblas</tt>
installation from your system for the building of the Debian package
to finish successfully:</p>


<div class="pygments_murphy"><pre>sudo aptitude purge libopenblas-{base,dev}
</pre></div>



</div>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Use apt-get to install Python dependencies for Travis CI</title>
      <link>http://danielnouri.org/notes/2012/11/23/use-apt-get-to-install-python-dependencies-for-travis-ci</link>
      <pubDate>Fri, 23 Nov 2012 23:15:00 CET</pubDate>
      <category><![CDATA[Python]]></category>
      <category><![CDATA[Programming]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/11/23/use-apt-get-to-install-python-dependencies-for-travis-ci</guid>
      <description>Use apt-get to install Python dependencies for Travis CI</description>
      <content:encoded><![CDATA[<div class="document">
<p><a class="reference external" href="http://about.travis-ci.org/">Travis CI</a> is used by more and more
open source Python projects to do their continous testing.
<a class="reference external" href="http://scikit-learn.org/">scikit-learn</a> is the <a class="reference external" href="https://github.com/scikit-learn/scikit-learn/pull/1397">latest</a> project to
adopt it.</p>
<p>With Travis, usually you'll use <tt class="docutils literal">pip</tt> or <tt class="docutils literal">setuptools</tt> to get your
project's Python dependencies installed before running the test
script.  Here's the minimal <tt class="docutils literal">.travis.yml</tt> example from the <a class="reference external" href="http://about.travis-ci.org/docs/user/languages/python/">Travis
docs for Python</a>, one that
will install dependencies using <tt class="docutils literal">pip</tt> before it runs <tt class="docutils literal">nosetests</tt>:</p>


<div class="pygments_murphy"><pre><span class="l-Scalar-Plain">language</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">python</span>
<span class="l-Scalar-Plain">python</span><span class="p-Indicator">:</span>
  <span class="p-Indicator">-</span> <span class="s">&quot;2.6&quot;</span>
  <span class="p-Indicator">-</span> <span class="s">&quot;2.7&quot;</span>
  <span class="p-Indicator">-</span> <span class="s">&quot;3.2&quot;</span>
<span class="c1"># command to install dependencies</span>
<span class="l-Scalar-Plain">install</span><span class="p-Indicator">:</span> <span class="s">&quot;pip</span><span class="nv"> </span><span class="s">install</span><span class="nv"> </span><span class="s">-r</span><span class="nv"> </span><span class="s">requirements.txt</span><span class="nv"> </span><span class="s">--use-mirrors&quot;</span>
<span class="c1"># command to run tests</span>
<span class="l-Scalar-Plain">script</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">nosetests</span>
</pre></div>



<p>There is however some dependencies where this is problematic.  Two of
those are <a class="reference external" href="http://numpy.scipy.org/">numpy and scipy</a>, which contain
a lot of C code that, with the method just discussed, needs to be
compiled every time you run the Travis tests.</p>
<p>Travis allows you to install system packages through <tt class="docutils literal"><span class="pre">apt-get</span></tt>,
which is quite cool.  And there's already the binary <tt class="docutils literal"><span class="pre">python-numpy</span></tt>
and <tt class="docutils literal"><span class="pre">python-scipy</span></tt> packages in Ubuntu, so why not use them?</p>
<p>The problem is that simply installing them via <tt class="docutils literal"><span class="pre">apt-get</span></tt> does not
work for the same reason it doesn't work when you do this locally: The
default <tt class="docutils literal">virtualenv</tt> that Travis sets up for you to run the tests in
is <a class="reference external" href="http://about.travis-ci.org/docs/user/languages/python/#Travis-CI-Uses-Isolated-virtualenvs">isolated</a>
from the system packages, so it won't see those globally installed
<tt class="docutils literal">numpy</tt> and <tt class="docutils literal">scipy</tt> packages.</p>
<p>The solution for this is use <tt class="docutils literal">virtualenv</tt> with the
<tt class="docutils literal"><span class="pre">--system-site-packages</span></tt> option, which allows you to also import
packages from the global site packages directory.</p>
<div class="section" id="how-it-works">
<h3>How it works</h3>
<p>Add these lines to your Travis configuration to use a <tt class="docutils literal">virtualenv</tt>
with <tt class="docutils literal"><span class="pre">--system-site-packages</span></tt>:</p>


<div class="pygments_murphy"><pre><span class="l-Scalar-Plain">virtualenv</span><span class="p-Indicator">:</span>
  <span class="l-Scalar-Plain">system_site_packages</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">true</span>
</pre></div>



<p>You can thus install Python packages via <tt class="docutils literal"><span class="pre">apt-get</span></tt> in the
<tt class="docutils literal">before_install</tt> section, and use them in your virtualenv:</p>


<div class="pygments_murphy"><pre><span class="l-Scalar-Plain">before_install</span><span class="p-Indicator">:</span>
 <span class="p-Indicator">-</span> <span class="l-Scalar-Plain">sudo apt-get install -qq python-numpy python-scipy</span>
</pre></div>



<p>A real-world use of this approach can be found in <a class="reference external" href="https://github.com/dnouri/nolearn/blob/master/.travis.yml">nolearn</a>.</p>
</div>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>GazaUnderAttack essential reading</title>
      <link>http://danielnouri.org/notes/2012/11/17/gazaunderattack-essential-reading</link>
      <pubDate>Sat, 17 Nov 2012 18:00:00 CET</pubDate>
      <category><![CDATA[Palestine]]></category>
      <category><![CDATA[Politics]]></category>
      <category><![CDATA[Israel]]></category>
      <category><![CDATA[Gaza]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/11/17/gazaunderattack-essential-reading</guid>
      <description>GazaUnderAttack essential reading</description>
      <content:encoded><![CDATA[<div class="document">
<p>This is a collection of what I consider essential articles and
interviews on the topic of the recent attacks on Gaza
(<a class="reference external" href="https://twitter.com/search?q=%23gazaunderattack">#GazaUnderAttack</a>), and on the wider
Israeli-Palestine conflict.</p>
<p>The mainstream media are sadly very biased with regard to this topic.
This is true even for outlets that are commonly considered liberal.
It's essential for anyone who wants to get a good understanding, and
for anyone who wants to eventually be part of the solution of this
decade-long conflict, to inform themselves through their own research.
And here's some hopefully useful pointers for doing that.</p>
<blockquote class="twitter-tweet"><p>Who's aggressor, who's victim? Here's a clue. Palestinians killed by Israelis in last 10 yrs: 3,434. Israelis by Palestinians 78.(UN figs)</p>&mdash; MartinLinton (@martinlinton) <a href="https://twitter.com/martinlinton/status/269431720485482497" data-datetime="2012-11-16T13:28:22+00:00">November 16, 2012</a></blockquote><div class="section" id="israel-and-palestine-an-animated-introduction-video">
<h3>Israel and Palestine, an animated introduction <em>[video]</em></h3>
<iframe width="640" height="360" src="https://www.youtube-nocookie.com/embed/Y58njT2oXfE?rel=0" frameborder="0" allowfullscreen></iframe><p>From the description of the video:</p>
<blockquote>
Hey friends-it's time to stop saying, &quot;It's too complicated!&quot; You
can't stay on the sidelines anymore. Watch this Jewish Voice for
Peace 6 minute mini-primer about why Israelis and Palestinians are
fighting, why the US-backed peace process has been an impediment to
peace, and what you can do to make a difference. Find out more at
<a class="reference external" href="http://www.jvp.org/101">www.jvp.org/101</a></blockquote>
</div>
<div class="section" id="impressions-of-gaza-noam-chomsky-4-nov-article">
<h3>Impressions of Gaza, Noam Chomsky, 4 Nov <em>[article]</em></h3>
<blockquote class="twitter-tweet"><p>Maybe you might like to read a bit about what's happening in Gaza? This is Chomsky's recent article. Feel free to RT.<a href="http://t.co/SyEvq7Du" title="http://chomsky.info/articles/20121104.htm">chomsky.info/articles/20121…</a></p>&mdash; Frankie Boyle (@frankieboyle) <a href="https://twitter.com/frankieboyle/status/268878939936681984" data-datetime="2012-11-15T00:51:49+00:00">November 15, 2012</a></blockquote></div>
<div class="section" id="palestine-2012-gaza-and-the-un-resolution-noam-chomsky-1-dec-article">
<h3>Palestine 2012 – Gaza and the UN resolution, Noam Chomsky, 1 Dec <em>[article]</em></h3>
<blockquote>
An old man in Gaza held a placard that reads: “You take my water,
burn my olive trees, destroy my house, take my job, steal my land,
imprison my father, kill my mother, bombard my country, starve us
all, humiliate us all but I am to blame: I shot a rocket back.”
<a class="reference external" href="http://www.israeli-occupation.org/2012-12-01/noam-chomsky-palestine-2012-gaza-and-the-un-resolution/">Read the article ...</a></blockquote>
</div>
<div class="section" id="israel-s-gaza-rampage-its-not-just-war-john-pilger-21-nov-article">
<h3>Israel's Gaza Rampage: It’s Not Just War, John Pilger, 21 Nov <em>[article]</em></h3>
<p><a class="reference external" href="http://www.counterpunch.org/2012/11/21/israels-gaza-rampage-its-not-just-war/">An Interview With John Pilger</a></p>
</div>
<div class="section" id="bodies-for-ballots-yousef-munayyer-15-nov-article">
<h3>Bodies for Ballots, Yousef Munayyer, 15 Nov <em>[article]</em></h3>
<blockquote class="twitter-tweet"><p>A true must-read from @<a href="https://twitter.com/yousefmunayyer">yousefmunayyer</a> on the Israeli air attacks on Gaza<a href="http://t.co/6Ylh0PNX" title="http://is.gd/LcHoc5">is.gd/LcHoc5</a></p>&mdash; Glenn Greenwald (@ggreenwald) <a href="https://twitter.com/ggreenwald/status/269117288224014336" data-datetime="2012-11-15T16:38:56+00:00">November 15, 2012</a></blockquote></div>
<div class="section" id="us-blocks-un-security-council-from-condemning-israeli-attack-on-gaza-vijay-prashad-15-nov-video">
<h3>US blocks UN Security Council from condemning Israeli attack on Gaza, Vijay Prashad, 15 Nov <em>[video]</em></h3>
<blockquote class="twitter-tweet"><p>At UN Security Council meeting, US stands with <a href="https://twitter.com/search/%23Israel">#Israel</a>, blocks resolution: <a href="http://t.co/v66RiFLY" title="http://truth-out.org/news/item/12782-un-holds-urgent-security-council-meeting-us-stands-with-israel">truth-out.org/news/item/1278…</a> @<a href="https://twitter.com/vijayprashad">vijayprashad</a> <a href="https://twitter.com/search/%23GazaUnderAttack">#GazaUnderAttack</a></p>&mdash; Truthout (@truthout) <a href="https://twitter.com/truthout/status/269532867464413185" data-datetime="2012-11-16T20:10:17+00:00">November 16, 2012</a></blockquote><iframe width="476" height="350" src="https://www.youtube-nocookie.com/embed/NRpUNNqoSD0?rel=0" frameborder="0" allowfullscreen></iframe></div>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>python-mode gone wrong</title>
      <link>http://danielnouri.org/notes/2012/11/16/python-mode-gone-wrong</link>
      <pubDate>Fri, 16 Nov 2012 15:15:00 CET</pubDate>
      <category><![CDATA[Python]]></category>
      <category><![CDATA[Emacs]]></category>
      <category><![CDATA[Programming]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/11/16/python-mode-gone-wrong</guid>
      <description>python-mode gone wrong</description>
      <content:encoded><![CDATA[<div class="document">
<div class="section" id="tl-dr">
<h3>tl;dr</h3>
<p>If you recently upgraded Emacs' <tt class="docutils literal"><span class="pre">python-mode</span></tt> to version 6.0 or
higher, and it feels wrong (indentation seems broken, the menu is
confusing), downgrade to version 5.  In Debian or Ubuntu you can do it
like so:</p>


<div class="pygments_murphy"><pre>sudo aptitude install python-central pymacs
wget http://launchpadlibrarian.net/22053597/python-mode_5.1.0-1_all.deb
sudo dpkg -i python-mode_5.1.0-1_all.deb
</pre></div>



</div>
<div class="section" id="broken-hearts">
<h3>Broken hearts</h3>
<p>Something terrible happened.  My beloved <tt class="docutils literal"><span class="pre">python-mode</span></tt> for Emacs has
been infested with <a class="reference external" href="https://en.wikipedia.org/wiki/Feature_creep">featuritis</a>, and it doesn't look
like it's coming back.</p>
<p>Yesterday I upgraded to Xubuntu 12.10 for my work laptop.  That was
after it turned out that I'm not manly enough to install Debian Wheezy
proper.  (What the f--k is wrong with your WLAN support, Debian!!)</p>
<p>With Xubuntu and a few tweaks you can luckily ignore all the less
fortunate decisions that Ubuntu has made recently.  No Unity means no
Dash means no <a class="reference external" href="https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-amazon-ads-and-data-leaks">broken privacy out of the box</a>.</p>
<p><tt class="docutils literal">Synaptic</tt> and <tt class="docutils literal">GDebi</tt> are quickly installed to replace the
ad-ridden and sluggish Ubuntu Software Center.  And packages rock
again and are fast.  Also, I've come to really like Xfce; but I
digress...</p>
<p>So far so good.  Then I installed Emacs and <tt class="docutils literal"><span class="pre">python-mode</span></tt> and
started editing my first Python file.  Which was when I fell into a
deep shock.  A few things felt just plain wrong.  In fact so wrong
that I was sure I had the wrong mode active (namely the other
<tt class="docutils literal">python.el</tt>, which ships with Emacs).  For hours and hours I
searched for a way to disable Emacs' own Python mode and enable the
&quot;good one&quot;, <a class="reference external" href="http://superuser.com/questions/108233/how-can-i-prevent-the-python-el-that-ships-with-emacs-23-from-ever-loading">tried some hacks</a>,
but it wouldn't work.  Because, really I was using the right mode all
the time, but <tt class="docutils literal"><span class="pre">python-mode</span></tt> had changed so much I couldn't recognize
it anymore.</p>
<p>Firstly, the menu entries are completely different.  Instead of the
two entries &quot;IM-Python&quot;, and &quot;Python&quot; (which I hardly ever used),
there's now five different menus called &quot;PyShell&quot;, &quot;PyEdit&quot;, &quot;PyExec&quot;,
&quot;PyTools&quot; and &quot;Outline&quot;, each with a shitload of entries inside, with
mostly either trivial things, or stuff I have no idea what they're
good for.</p>
<p>Take an example: The newer <tt class="docutils literal"><span class="pre">python-mode</span></tt> added skeletons.  So that
now instead of writing a <em>for</em> statement, you can now call up a macro
that will ask you what to put into the name and expression parts of
the statement, and then it'll write it.  Yes, friends, imagine that
instead of writing <tt class="docutils literal">for foo in baz:</tt>, you can now call up this
insanely useful macro and it will ask you to enter <tt class="docutils literal">foo</tt> and then
you hit enter and then it asks for <tt class="docutils literal">baz</tt>, enter, and then it will
write the line <tt class="docutils literal">for foo in baz:</tt>.</p>
<p>What the f--k?</p>
<p>Surely, you could say I can ignore all of this seemingly useless
functionality.  After all, it might be useful to <em>someone</em> (it's
NOT!!).  But it still leaves a very bad taste in my mouth.  I feel
alarmed that my beloved <tt class="docutils literal"><span class="pre">python-mode</span></tt> seems to have taken a step
into a very bad direction.  And I wonder if with all these added
features, is it going to be as well-maintained?  Is it going to make
similar decisions in the future, ones that will affect me more?  (This
is software that I rely on for my daily work.)</p>
<p>And it looks like my fears are already confirmed.  It turns out
<tt class="docutils literal"><span class="pre">python-mode</span></tt> gets indentation wrong, arguably the most fundamental
feature of any Python editing mode, or has anyway changed the way it
works.  As an example, if you hit enter where the <tt class="docutils literal">X</tt> is below, it
will indent four characters:</p>


<div class="pygments_murphy"><pre><span class="k">class</span> <span class="nc">Bar</span><span class="p">:</span>
    <span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">pass</span>

<span class="n">Xclass</span> <span class="n">Baz</span><span class="p">:</span>
</pre></div>



<p>So that you'll end up with:</p>


<div class="pygments_murphy"><pre><span class="k">class</span> <span class="nc">Bar</span><span class="p">:</span>
    <span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">pass</span>

    <span class="k">class</span> <span class="nc">Baz</span><span class="p">:</span>
</pre></div>



<p>(Where what you really wanted is put a blank line between them, or
maybe add a new method to <tt class="docutils literal">Bar</tt>.)</p>
<p>So what I did after I realized what was going on was to downgrade to
<tt class="docutils literal"><span class="pre">python-mode</span> 5.1</tt>, and finally my blood pressure went back to
normal.</p>
<p>I'd be interested to hear other people's experiences with
<tt class="docutils literal"><span class="pre">python-mode</span> 6</tt>, I wonder if I'm alone.</p>
</div>
<div class="section" id="screenshots">
<h3>Screenshots</h3>
<p>Here's the two versions with their respective menus.</p>
<div class="section" id="python-mode-version-5">
<h4>python-mode version 5</h4>
<p><em>Simple is better than complex</em></p>
<img alt="python-mode version 5" src="http://danielnouri.org/media/python-mode-version-5-screenshot.png" />
</div>
<div class="section" id="python-mode-version-6">
<h4>python-mode version 6</h4>
<p><em>F--k simple, let's do a million features because we can</em></p>
<img alt="python-mode version 6" src="http://danielnouri.org/media/python-mode-version-6-screenshot.png" />
</div>
</div>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Appetite for economic gain not a natural force</title>
      <link>http://danielnouri.org/notes/2012/08/26/appetite-for-economic-gain-not-a-natural-force</link>
      <pubDate>Sun, 26 Aug 2012 12:30:00 CEST</pubDate>
      <category><![CDATA[Politics]]></category>
      <category><![CDATA[Economy]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/08/26/appetite-for-economic-gain-not-a-natural-force</guid>
      <description>Appetite for economic gain not a natural force</description>
      <content:encoded><![CDATA[<div class="document">
<p>While reading Erich Fromm's <a class="reference external" href="http://en.wikipedia.org/wiki/Escape_from_Freedom">Escape From Freedom</a>, I came across this
passage from English economic historian <a class="reference external" href="http://en.wikipedia.org/wiki/R._H._Tawney">R. H. Tawney's</a> book
<em>Religion and the Rise of Capitalism</em>, which elaborates <strong>the medieval
view on economic activities</strong>:</p>
<blockquote>
Material riches are necessary; they have secondary importance, since
without them men cannot support themselves and help one another
[...] But economic motives are suspect.  Because they are powerful
appetites, men fear them, but they are not mean enough to applaud
them [...] <strong>There is no place in medieval theory for economic
activity which is not related to a moral end, and to found a science
of society upon the assumption that the appetite for economic gain
is a constant and measurable force, to be accepted like other
natural forces, as an inevitable and self-evident datum, would have
appeared to the medieval thinker as hardly less irrational and less
immoral than to make the premise of social philosophy the
unrestrained operation of such necessary human attributes as
pugnacity and the sexual instinct</strong> [...] Riches, as St. Antonio
says, exist for man, not man for riches [...] At every turn
therefore, there are limits, restrictions, warnings against allowing
economic interests to interfere with serious affairs.  It is right
for a man to seek such wealth as is necessary for a livelihood in
his station.  To seek more is not enterprise, but avarice, and
avarice is a deadly sin.  Trade is legitimate; the different
resources of different countries show that it was intended by
Providence.  But it is a dangerous business.  A man must be sure
that he carries it on for the public benefit, and that the profits
which he takes are no more than the wages of his labour.  Private
property is a necessary institution, at least in a fallen world; men
work more and dispute less when goods are private than when they are
common.  But it is to be tolerated as a concession to human frailty,
not applauded as desirable in itself; the ideal—if only man's nature
could rise to it—is communism.  &quot;Communis enim,&quot; wrote Gratian in
his decretum, &quot;usus omnium quae sunt in hoc mundo, omnibus hominibus
esse debuit.&quot;  <a class="footnote-reference" href="#id2" id="id1">[1]</a> At best, indeed, the estate is somewhat
encumbered.  It must be legitimately acquired.  It must be in the
largest possible number of hands.  It must provide for the support
of the poor.  Its use must as far as practicable be common.  Its
owners must be ready to share it with those who need, even if they
are not in actual destitution.</blockquote>
<p>(My emphasis)</p>
<p>According to Tawney, the basic medieval assumptions concerning
economic life were two: &quot;That economic interests are subordinate to
the real business of life, which is salvation, and that economic
conduct is one aspect of personal conduct, upon which as on other
parts of it, the rules of morality are binding.&quot;</p>
<p>Today, it seems that people often assume that the free market is a
natural force and that other apects of human life, out of necessity,
have to be subordinate to it.  It turns out that in the Middle Ages,
the opposite was expressed in the doctrines of the Catholic Church,
and in secular law.</p>
<p>To constantly portray the capitalist market as a natural force, <a class="reference external" href="http://danielnouri.org/notes/2012/03/18/climate-science---the-forbidden-topics/">as
the corporate media does</a>, is to help sustain these avaricious
economic interests that threaten to destroy our planet, and that are a
direct cause of immense human suffering around the world.</p>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>This should translate to something like: &quot;Common to all humans
should be the use of things found on Earth.&quot;</td></tr>
</tbody>
</table>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Pyramid EuroPython tutorial video</title>
      <link>http://danielnouri.org/notes/2012/08/16/pyramid-europython-tutorial-video</link>
      <pubDate>Thu, 16 Aug 2012 11:30:00 CEST</pubDate>
      <category><![CDATA[Python]]></category>
      <category><![CDATA[Web]]></category>
      <category><![CDATA[Pyramid]]></category>
      <category><![CDATA[Programming]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/08/16/pyramid-europython-tutorial-video</guid>
      <description>Pyramid EuroPython tutorial video</description>
      <content:encoded><![CDATA[<div class="document">
<p>Here's the videos and material for the <em>Writing a Pyramid application</em>
tutorial that I gave at last month's <a class="reference external" href="https://ep2012.europython.eu">EuroPython 2012</a>.</p>
<p>The tutorial is around 3,5 hours long.  The <a class="reference external" href="https://github.com/dnouri/pyramid-tutorial">accompanying material
includes code and documentation</a> for the seven
individual steps of the tutorial (<tt class="docutils literal">ex1_hello</tt> through
<tt class="docutils literal">ex7_final</tt>).</p>
<iframe width="640" height="360" src="https://www.youtube.com/embed/dKZjbm_qLUM" frameborder="0" allowfullscreen></iframe><iframe width="640" height="360" src="https://www.youtube.com/embed/vNvMAOko6ME" frameborder="0" allowfullscreen></iframe><p>(Head <a class="reference external" href="http://danielnouri.org/notes/2012/08/16/pyramid-europython-tutorial-video/">here</a>
if the videos aren't displayed.)</p>
<p>This is the tutorial's <strong>complete description</strong> of the tutorial from
the EuroPython website:</p>
<p><a class="reference external" href="http://www.pylonsproject.org/projects/pyramid/about">Pyramid</a> is a
very general open source Python web framework. As a framework, its
primary job is to make it easier for a developer to create an
arbitrary web application. The type of application being created isn’t
really important; it could be a spreadsheet, a corporate intranet, or
a social networking platform. Pyramid is general enough that it can be
used in a wide variety of circumstances.</p>
<p><strong>In this tutorial</strong> you will build from scratch a simple app in which
users each have their individual workspaces, and can invite other
users to collaboratively edit content.</p>
<p>While writing the application, you will learn about many aspects of
Pyramid.  Concretely, you will learn how to:</p>
<ul class="simple">
<li><strong>Install</strong> Pyramid within a <a class="reference external" href="http://www.virtualenv.org/">virtualenv</a></li>
<li>Use Pyramid's scaffolds to <strong>quickstart</strong> your project</li>
<li>Work efficiently with <strong>templates</strong> (using <a class="reference external" href="http://chameleon.repoze.org/">Chameleon</a>)</li>
<li>Create <strong>models</strong> and <strong>views</strong></li>
<li>Write your own user <strong>authentication</strong></li>
<li>Make use of Pyramid's <strong>Access Control Lists</strong> support</li>
<li>Use Pyramid's <strong>Traversal</strong> to map URL paths to your objects</li>
<li>Create <strong>forms</strong> using the <a class="reference external" href="http://docs.pylonsproject.org/projects/deform/">deform form library</a></li>
<li>Work with the <a class="reference external" href="http://www.zodb.org/">ZODB</a>, a convenient
<strong>database</strong> to store your Python objects in.</li>
</ul>
<p>The tutorial will be split into steps with each step accomplishing a
certain set of goals.  Documented code for all the individual steps,
including the final application, will be made available to
participants.</p>
<p><strong>Prerequisites</strong>: If you're on Mac OSX or Windows and you don't have
Python 2.6 or Python 2.7 installed, you might want to run through the
<a class="reference external" href="http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/install.html">Pyramid installation instructions</a>
prior to the tutorial.</p>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Kotti Werkpalast Sprint Wrap Up</title>
      <link>http://danielnouri.org/notes/2012/05/28/kotti-werkpalast-sprint-wrap-up</link>
      <pubDate>Mon, 28 May 2012 18:30:00 CEST</pubDate>
      <category><![CDATA[Python]]></category>
      <category><![CDATA[Web]]></category>
      <category><![CDATA[Pyramid]]></category>
      <category><![CDATA[Programming]]></category>
      <category><![CDATA[Kotti]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/05/28/kotti-werkpalast-sprint-wrap-up</guid>
      <description>Kotti Werkpalast Sprint Wrap Up</description>
      <content:encoded><![CDATA[<div class="document">
<p>Last week's Kotti sprint in Berlin was full of win.  Here's a summary
of what we worked on.  (Sprinters: If I forgot to mention anything,
please let me know and I'll update.)</p>
<a href="http://www.flickr.com/photos/77236500@N07/7267018542/" title="IMG_0660 by d1sk0, on Flickr"><img src="http://farm8.staticflickr.com/7105/7267018542_f8dc1f3850.jpg" width="500" height="374" alt="IMG_0660"></a><div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#search-and-kotti-solr" id="id2">Search and kotti_solr</a></li>
<li><a class="reference internal" href="#snippets-slots-and-pyramid-snippets" id="id3">Snippets, slots and pyramid_snippets</a></li>
<li><a class="reference internal" href="#images" id="id4">Images</a></li>
<li><a class="reference internal" href="#rich-text-editing" id="id5">Rich text editing</a></li>
<li><a class="reference internal" href="#http-caching" id="id6">HTTP Caching</a></li>
<li><a class="reference internal" href="#paster-templates" id="id7">Paster templates</a></li>
</ul>
</div>
<div class="section" id="search-and-kotti-solr">
<h3><a class="toc-backref" href="#id2">Search and kotti_solr</a></h3>
<p>Andi (witsch), Marco and Nuno worked on adding search to Kotti.  Kotti
now has a search box at the top right of the site that searches the
'title' and 'description' fields of content in the database.  A
setting called <tt class="docutils literal">kotti.search_content</tt> allows the search function to
be overridden.  Which is where <a class="reference external" href="https://github.com/teixas/kotti_solr">kotti_solr</a> hooks in to provide search
through Solr.  kotti_solr has a buildout that installs Solr, and it's
already working, but will currently only search the same 'title' and
'description' fields.  (That is, it will need to grow adapters so that
we can extract all searchable text from content.)</p>
<p>The basic search has already landed in Kotti's master branch in Git
and will be available in the next version.  There's still a few issues
that need to be worked on here before that can happen though:</p>
<ul class="simple">
<li>Do permission checks with search results; at the moment search will
return all items, whether the user has permission to see them or
not.  (Maybe this is a good time to consider adding something like
CMF's <tt class="docutils literal">allowedUsersAndRoles</tt> index to Kotti's Node.)</li>
<li>Document the <tt class="docutils literal">kotti.search_content</tt> setting.</li>
</ul>
<p>We could also use some help in styling the search box and search
results better.  You can test drive the search on the <a class="reference external" href="http://kottidemo.danielnouri.org/">demo site</a>.</p>
</div>
<div class="section" id="snippets-slots-and-pyramid-snippets">
<h3><a class="toc-backref" href="#id3">Snippets, slots and pyramid_snippets</a></h3>
<p>Christian, Florian, Krille and Ibi worked on adding support for what
Wordpress calls <a class="reference external" href="http://codex.wordpress.org/Shortcode">Shortcodes</a>
and MoinMoin calls <a class="reference external" href="http://moinmo.in/HelpOnMacros">macros</a>.</p>
<p>With this, users will be able to insert codes like <tt class="docutils literal">[gallery]</tt> into
their pages and have these render to dynamic elements in the public
view.  Shortcodes may also take arguments like <tt class="docutils literal"><span class="pre">[table-of-contents</span>
level=3]</tt>.  We <a class="reference external" href="https://groups.google.com/d/topic/kotti/Kck0kYK3EkQ/discussion">discussed this idea</a>
back in February on the list.</p>
<p>The team decided they would move the core functionality behind what
they call <em>snippets</em> into a separate package <a class="reference external" href="https://github.com/fschulze/pyramid_snippets">pyramid_snippets</a>.  The idea is that
snippets behave like views with the advantage that they can be easily
pulled in via AJAX and be used in other places in the site, like in
the portlet columns.  The integration with Kotti is happening in the
<a class="reference external" href="https://github.com/chrneumann/Kotti/tree/snippets">snippets branch</a>.  Plans are to
add a button to TinyMCE that allows users to add snippets instead of
having to remember the codes and syntax.</p>
<p>We also want to eventually deprecate <a class="reference external" href="http://kotti.readthedocs.org/en/latest/developer-manual.html#module-kotti.views.slots">Kotti's slots</a>
and unify them with snippets so that slot renderers will become views
and can be used as snippets and vice versa.</p>
</div>
<div class="section" id="images">
<h3><a class="toc-backref" href="#id4">Images</a></h3>
<p>Anreas (disko) added a new Image type and image scaling to Kotti core.
He extracted these out of the nice <a class="reference external" href="https://github.com/disko/kotti_image_gallery">kotti_imagegallery</a> add-on that he had
written earlier.</p>
<p>Predefined image scales include <tt class="docutils literal">span1</tt> (60x120) to <tt class="docutils literal">span12</tt>
(1160x2320).  Additional image scales can be configured through the
<tt class="docutils literal">kotti.image_scales</tt> variables.</p>
</div>
<div class="section" id="rich-text-editing">
<h3><a class="toc-backref" href="#id5">Rich text editing</a></h3>
<p>Andreas (disko) and Daniel worked on improving the rich text editing
story for Kotti.  Based on the work done on images and scaling by
Andreas, they created <a class="reference external" href="https://github.com/dnouri/kotti_tinymce">kotti_tinymce</a>, which is an add-on that
provides image and file upload, browsing and insertion through
TinyMCE.</p>
<p>kotti_tinymce is actually based on the <a class="reference external" href="https://github.com/plone/Products.TinyMCE">Products.TinyMCE</a> add-on for Plone, and
uses the exact same JavaScript resources.  Only page templates and CSS
are overridden and the server-side AJAX hooks implemented to work with
Kotti.  (We were quite amazed at how well this worked out.)</p>
<p>One problem with kotti_tinymce is that there's no functional tests.
We've just verified that things are working by clicking through all
the dialogues manually.  Considering that Products.TinyMCE is evolving
separately and that we want to maintain upstream compatibility, we
really want to implement some browser-based functional tests to be
able to guarantee a reasonable level of stability.  These tests will
also help us fix the remaining bugs in kotti_tinymce.</p>
<p>You can try out the rich text editing improvements on the <a class="reference external" href="http://kottidemo.danielnouri.org/">demo
site</a>!</p>
</div>
<div class="section" id="http-caching">
<h3><a class="toc-backref" href="#id6">HTTP Caching</a></h3>
<p>Andreas (disko) and Daniel added <a class="reference external" href="https://github.com/Kotti/Kotti/blob/master/kotti/views/cache.py">HTTP caching</a>
into the Kotti core.  There's now a default caching policy which may
be overridden using the <tt class="docutils literal">kotti.caching_policy_chooser</tt> setting.  The
default policy is to not cache HTML, cache media for four hours, cache
static resources for a month and so on.</p>
<p>The http caching code is <a class="reference external" href="http://danielnouri.org/notes/2011/02/12/http-caching-for-the-masses/">based on code</a>
previously written by Daniel.</p>
</div>
<div class="section" id="paster-templates">
<h3><a class="toc-backref" href="#id7">Paster templates</a></h3>
<p>Marco and Tom worked on <a class="reference external" href="https://github.com/j23d/kotti_paster">kotti_paster</a> which Marco initially
started.  They've been working on a set of accumulative templates for
Kotti that are based around Buildout and try to define best practices
for different aspects of Kotti and Pyramid development for beginners.</p>
<a href="http://www.flickr.com/photos/77236500@N07/7267021654/" title="IMG_0665 by d1sk0, on Flickr"><img src="http://farm9.staticflickr.com/8016/7267021654_8c7124e8ac.jpg" width="500" height="374" alt="IMG_0665"></a></div>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Climate Science - The Forbidden Topics</title>
      <link>http://danielnouri.org/notes/2012/03/18/climate-science---the-forbidden-topics</link>
      <pubDate>Sun, 18 Mar 2012 14:00:00 CET</pubDate>
      <category><![CDATA[Environment]]></category>
      <category><![CDATA[Media]]></category>
      <category><![CDATA[Politics]]></category>
      <category><![CDATA[Economy]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2012/03/18/climate-science---the-forbidden-topics</guid>
      <description>Climate Science - The Forbidden Topics</description>
      <content:encoded><![CDATA[<div class="document">
<p>The following is an excerpt from the book <strong>Newspeak in the 21st
Century</strong> by David Edwards and David Cromwell of <a class="reference external" href="http://www.medialens.org/">Media Lens</a> published in 2009 by Pluto Press.  You
can find out <a class="reference external" href="http://www.medialens.org/bookshop/newspeak.php">more about the book and buy it here</a>.</p>
<hr class="docutils" />
<p>In 2006, an explosive front-page article in the <em>Independent</em> was
titled: <a class="reference external" href="http://www.independent.co.uk/environment/earths-ecological-debt-crisis-mankinds-borrowing-from-nature-hits-new-record-419279.html">&quot;Earth's ecological debt crisis: mankind's 'borrowing' from
nature hits new record.&quot;</a>
Martin Hickman, the newspaper's consumer affairs correspondent,
explained the results of a study featured in the story:</p>
<blockquote>
Evidence is mounting that rapid population growth and rising living
standards among the Earth's six billion inhabitants are putting an
intolerable strain on nature. For the first time an organisation — a
British think-tank — has sought to pinpoint how quickly man is using
the global resources of farming land, forests, fish, air and energy.</blockquote>
<p>By analysing data from the US academic group Global Footprint Network,
the think-tank has worked out the day each year when &quot;humanity starts
eating the planet&quot;.  Just like a company bound for bankruptcy, the
world started falling into ecological debt on October 9 that year.
Hickman explained: &quot;Problems, affecting everything from the seabed to
the stratosphere, range from carbon dioxide emissions to the
destruction of rainforests to the intensification of agriculture&quot;.
The crisis Hickman was describing could hardly be more serious:
humanity really is devouring the planet's life-support systems.  And
yet, typically for mainstream reporting, Hickman's analysis of the
causes behind the crisis was lost in unsupported, clichéd assertions
about &quot;rapid population growth&quot; and global &quot;rising living standards&quot;.
It is not just that &quot;mankind&quot; is &quot;'borrowing' from nature&quot;, as Hickman
claimed — the problem is rooted in a particular form of politics
controlled by wealthy elites.</p>
<p>Consider some of the key issues that <em>should</em> be at the heart of any
analysis of the looming catastrophe under discussion.  And consider
how inclusion of these issues is all but inconceivable in any
corporate newspaper.  These issues include:</p>
<ol class="arabic simple">
<li>The inherently biocidal, indeed psychopathic, logic of corporate
capitalism, structurally locked into generating maximised revenues
in minimum time at minimum cost.  As corporations are legally
<em>obliged</em> to maximise profits for shareholders, it is in fact
illegal for corporations to prioritise the welfare of people and
planet above private profits.  How can this simple fact of
entrenched corporate immorality not be front and centre in any
discussion of the industrial destruction of global life-support
systems?</li>
<li>The proven track record of big business in promoting catastrophic
consumption regardless of the consequences for human and
environmental health.  Whether disregarding the links between smoke
and cancer, junk food and obesity, Third World exploitation and
human suffering, oil exploration and lethal climate change, factory
farming and animal suffering, high salt consumption and illness,
corporations have consistently subordinated human and animal
welfare to short-term profits.</li>
<li>The relentless corporate lobbying of government to shape policies
to promote and protect private power.</li>
<li>The billions spent by the advertising industry to promote consumer
products and services, creating artificial 'needs', with children
an increasing target.</li>
<li>The collusion between powerful companies, investors and state
planners to install compliant dictators in client states around the
world.</li>
<li>The extensive use of loans and tied aid that ensnare poor nations in
webs of debt, ensuring that the West retains control of their
resources, markets and development.</li>
<li>The deployment of threats, bribery and armed force against
countries that attempt to pursue self-development, rather than
economic or strategic planning sanctioned by 'the international
community'.</li>
<li>The lethal role of the corporate media in promoting the
planet-devouring aims of private power.</li>
</ol>
<p>In a powerful book titled <em>The Decline of Capitalism</em>, economist Harry
Shutt explains how the current system ensures &quot;the wasteful diversion
of economic value added into the pockets of the small minority who
also (through their disproportionate wealth) exercise largely
unaccountable political power&quot;.  As Shutt rightly concludes, global
capitalism is &quot;too dysfunctional to be tolerable in a civilised
society&quot;.  Forty years ago, Martin Luther King called for &quot;a radical
restructuring of the architecture of American society&quot;.  He observed:
&quot;Global capitalism is much more concerned with expanding the domain of
market relations than with, say, establishing democracy, expanding
elementary education, or enhancing the social opportunities of
society's underdogs.&quot;  Indeed, King increasingly questioned capitalism
towards the end of his life: an aspect of his inspirational speeches
that tends to be ignored by establishment commentators who are
otherwise keen to praise him.  He associated domestic racial and
social inequality with US imperialism and social disparity abroad,
denouncing what he called &quot;the triple evils that are interrelated&quot;:
&quot;racism, economic exploitation, and war&quot;.  In one speech, he said:</p>
<blockquote>
A nation that will keep people in slavery for 244 years will
'thingify' them - make them things.  Therefore they will exploit
them, and poor people generally, economically.  And a nation that
will exploit economically will have to have foreign investments and
everything else, and will have to use its military might to protect
them.  All of these problems are tied together.</blockquote>
<p>King decried the &quot;evils that are rooted deeply in the whole structure
of society&quot; which had &quot;systematic rather than superficial flaws&quot;.  He
concluded that &quot;radical reconstruction of society itself is the real
issue to be faced&quot;.  But this deep problem, facing anyone hoping for
genuine action to combat the environmental crisis, is beyond the pale
of mainstream thought and public debate.</p>
<p>Ecologist Franz Broswimmer put it this way: &quot;At its very core, the
prevailing capitalist ethos and liberal word view of the modern
industrial era remain expansionary and imperial, involving a
calculated form of indifference to the social and ecological order.&quot;
The social insanity of this capitalist-fuelled expansionism leads to
'inverted priorities', to adopt the phrase used by the social
scientist Immanuel Wallerstein.  Hence, dominant features of the
economy include a trillion-dollar global arms budget, depletion of the
planet's natural resources and a deepening economic apartheid between
rich and poor.  These features are, in the words of eco-feminist Mary
Mellor: &quot;not the neutral decisions of a market; they are the
priorities of powerful people in powerful nations, mostly men whose
gender, race, and class interests drive the capitalist political
economic system and its worldwide system of accumulation and
deprivation&quot;.  It is simply not possible to understand, far less to
address, the crises facing us without understanding these issues.
But, of course, they are simply &quot;not of this world&quot; from the
perspective of mainstream corporate news reporting and commentary.</p>
<p>These are compelling, evidence-based arguments that are buried beneath
the complacent clichés favoured by even the best newspapers.  We have
sketched them only in the briefest detail here - the point is they are
hardly ever discussed at all.</p>
<p><a class="reference external" href="http://www.medialens.org/bookshop/newspeak.php"><img alt="Newspeak in the 21st Century" src="http://www.medialens.org/bookshop/media/newspeak_cover.jpg" /></a></p>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>How to write an add-on for the Kotti CMS</title>
      <link>http://danielnouri.org/notes/2011/11/30/how-to-write-an-add-on-for-the-kotti-cms</link>
      <pubDate>Wed, 30 Nov 2011 14:00:00 CET</pubDate>
      <category><![CDATA[Python]]></category>
      <category><![CDATA[Web]]></category>
      <category><![CDATA[Pyramid]]></category>
      <category><![CDATA[Programming]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2011/11/30/how-to-write-an-add-on-for-the-kotti-cms</guid>
      <description>How to write an add-on for the Kotti CMS</description>
      <content:encoded><![CDATA[<div class="document">
<p>This <strong>screencast</strong> guides you through the process of creating an
add-on for the <a class="reference external" href="http://pypi.python.org/pypi/Kotti">Kotti content management system</a>.  In this tutorial we'll <strong>write
a simple commenting system</strong> in 21 minutes in <em>real-time</em>.</p>
<p>You'll be guided through:</p>
<ul class="simple">
<li>Installing Kotti itself</li>
<li>Creating your own Kotti add-on (a Python package)</li>
<li>Configuring your Kotti site to include your add-on</li>
</ul>
<iframe width="640" height="480" src="http://www.youtube-nocookie.com/embed/GC3tw6Tli54?rel=0" frameborder="0" allowfullscreen></iframe><p>(Click here <a class="reference external" href="http://danielnouri.org/notes/2011/11/30/how-to-write-an-add-on-for-the-kotti-cms/">if you don't see the video</a>.)</p>
<div class="section" id="where-to-go-from-here">
<h3>Where to go from here</h3>
<ul class="simple">
<li>Read Kotti's <a class="reference external" href="http://kotti.readthedocs.org">documentation on readthedocs.org</a></li>
<li>Try Kotti on the <a class="reference external" href="http://kottidemo.danielnouri.org">demo server</a></li>
<li>Find Kotti <a class="reference external" href="http://pypi.python.org/pypi/Kotti">releases on PyPI</a></li>
<li>Find Kotti's <a class="reference external" href="http://github.com/Kotti/Kotti">source on GitHub</a></li>
<li>Look at the source of two Kotti add-ons:<ul>
<li><a class="reference external" href="https://github.com/dnouri/kotti_twitter">kotti_twitter</a> adds a Twitter box</li>
<li><a class="reference external" href="https://github.com/dnouri/kotti_calendar">kotti_calendar</a> adds a calendar content type and events</li>
</ul>
</li>
</ul>
</div>
</div>
]]></content:encoded>
    </item>
    <item>
      <title>Nato's war crimes in Sirte</title>
      <link>http://danielnouri.org/notes/2011/10/03/nato's-war-crimes-in-sirte</link>
      <pubDate>Mon, 03 Oct 2011 19:00:00 CEST</pubDate>
      <category><![CDATA[Politics]]></category>
      <category><![CDATA[Libya]]></category>
      <guid isPermaLink="true">http://danielnouri.org/notes/2011/10/03/nato's-war-crimes-in-sirte</guid>
      <description>Nato's war crimes in Sirte</description>
      <content:encoded><![CDATA[
<p>
The National Transitional Council of Libya (NTC) announced on Friday a two-day truce in the conflict over the war-torn city of Sirte, with the alleged intent of allowing civilians to escape safely. Since then, the NTC violated their self-imposed truce in the worst way possible, namely by <a href="http://www.theaustralian.com.au/the-red-cross-delivers-medical-kits-body-bags-to-the-besieged-town-of-sirte-libya/story-fn7ycml4-1226155730689">shelling the city's main hospital</a> <em>while</em> a team of the International Committee of the Red Cross (ICRC) was visiting.
</p>

<p>
Citizens fleeing Sirte on Saturday <a href="http://www.irishtimes.com/newspaper/breaking/2011/1002/breaking51.html">told Reuters</a> they knew nothing of the ceasefire, and that the shelling by NTC forces had not stopped. <a href="http://www.nato.int/cps/en/natolive/news_71994.htm">NATO also continued its attacks</a> on the city throughout the weekend.
</p>

<p>
The NTC's siege of Sirte started over a month ago, when rebel leaders said that they hoped to <a href="http://www.telegraph.co.uk/news/worldnews/africaandindianocean/libya/8728752/Libya-crisis-Rebel-leaders-hoping-to-starve-Gaddafi-stronghold-of-Sirte-into-submission.html">"starve into submission"</a> the city, and cut off the city's electricity, water and supplies. Since then, Sirte has also seen daily NATO bombings and heavy artillery shelling by NTC forces. People fleeing Sirte on Sunday <a href="http://www.bbc.co.uk/news/mobile/world-africa-15141177">said</a> that they had to leave because they were "caught between Nato bombings and shelling by rebels," with NATO "bombing at random and often hitting civilian buildings."
</p>

<p>
The Telegraph talked to people fleeing the city who said that Nato bombing and more recently, the attacks by the NTC had turned Sirte into a <a href="http://www.telegraph.co.uk/news/worldnews/africaandindianocean/libya/8802302/Gaddafi-loyalists-stranded-as-battle-for-Sirte-rages.html">"living hell"</a>. An elderly lady shouted: "They are killing our children. Why are they doing this? For what? Life was good before!"
</p>

<p>
A Pakistani migrant worker who fled Sirte <a href="http://www.google.com/hostednews/afp/article/ALeqM5gFzmkHhiUt9Svv9K7eIHFiRTE0Zw?docId=CNG.b8d311ad4223657f5870feb8a7ea6ba2.71">said</a>: "Nato struck one big building, Imarat Tamim, two days ago, with 12 or 13 bombs. [...] The whole building with nearly 600 flats is razed to the ground now."
</p>

<div style="float: right; padding-left: 1em;">
<a href="http://www.youtube.com/watch?v=tlZdlUX9u_c"><img src="http://danielnouri.org/media/sirte-hospital.png" title="Sirte hospital"></img></a>
</div>

<p>
<a href="http://danielnouri.org/notes/2011/09/17/nato-bombs-residential-buildings-in-libya/">Videos</a> that emerged out of Sirte a week ago show <a href="http://www.youtube.com/user/42alfatah#p/u">bombed out civilian homes, schools, a radio station, and a big number of casualties</a>, among them many women and children.
</p>

<p>
The ICRC described the humanitarian situation in Sirte as very critical after they visited the city's main Ibn Sina hospital last weekend. The aid workers reported that the hospital lacks water, electricity, and basic medical supplies. A <a href="http://in.reuters.com/article/2011/10/03/idINIndia-59668820111003">hospital doctor told Reuters</a> that he saw "a child of 14 die on the operating table because the power went out during the operation."
</p>

<p>
Moreover, the ICRC reported that the hospital was in fact attacked by the NTC while their team was visiting. Hichem Khadhraoui from the ICRC said that "several rockets landed within the hospital buildings while [they] were there." From the AFP report:
</p>

<blockquote>
<p>
After the ICRC team went in, National Transitional Council fighters launched a ferocious attack with rockets, anti-tank cannons and machine gun fire from a position less than a kilometre from the hospital. Gaddafi loyalists responded with mortar and sniper fire.
</p>
<p>
"We were surprised" that the attack took place while the Red Cross team was visiting, Mr Khadhraoui said, adding that they had "contacted all parties to say we were going in."
</p>
</blockquote>

<p>
<strong>Update</strong>: <a href="http://www.eurasiareview.com/05102011-libya-nato-and-ntc-forces-bomb-sirte-hospital/">According to the ICRC</a>, the hospital was hit various times by NATO and NTC bombings. <a href="http://www.presstv.ir/detail/203060.html">Press TV reports</a> on Oct 6 that NATO has carried out a new round of airstrikes against Libya, targeting a hospital in the northern town of Sirte.
</p>

<p>
Bill Van Auken writes in a recent article titled <a href="http://www.wsws.org/articles/2011/sep2011/liby-s29.shtml">Mass killing and humanitarian disaster in NATO siege of Sirte</a>:
</p>

<blockquote>
<p>
At the time, the US and its NATO allies claimed that intervention was required to halt a supposedly imminent massacre of civilians in the eastern city of Benghazi. Since then, the NATO bombings and the civil war fomented by the Western powers have claimed far more lives than were ever threatened by the Gaddafi regime.
</p>

<p>
Now this resolution is being invoked to justify NATO and the militias it supports carrying out in Sirte precisely the kind of murderous siege against a civilian population that the US and the European imperialist powers pretended to be preventing.
</p>
</blockquote>

<p>
<a href="https://twitter.com/#!/SeumasMilne/status/120439210300813313">Seumas Milne</a> described NATO's self-proclaimed "mission to protect civilians" in Libya a "charade."
</p>

<p>
TeleSUR's Diego Marín is in Sirte and reports that the Red Cross confirmed that the city's main hospital was bombed by NATO. He also witnessed how the NTC actively hindered the Red Cross from reaching the city:
</p>
<p>
<iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/DkWhNvu8EQM?rel=0" frameborder="0" allowfullscreen></iframe>
</p>

<p>
CNN has actual footage of the Red Cross convoy being forced by rebel gunfire to turn around:
</p>
<p>
<iframe width="640" height="360" src="http://www.youtube-nocookie.com/embed/AwmX07cgsd0?rel=0" frameborder="0" allowfullscreen></iframe>
</p>

<p>
  Further reading:
</p>
<ul>
  <li><a href="http://wsws.org/articles/2011/oct2011/liby-o04.shtml">NATO assault on Sirte inflicts more Libyan civilian casualties</a>, Patrick O'Connor (World Socialist Web Site), Oct 4</li>
  <li><a href="http://danielnouri.org/notes/category/libya/">Related blog posts</a></li>
</ul>
]]></content:encoded>
    </item>
  </channel>
</rss>
