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

<channel>
	<title>Pascal Schulthess</title>
	<atom:link href="http://pascalschulthess.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://pascalschulthess.de</link>
	<description>The only true voyage of discovery, the only fountain of Eternal Youth, would be not to visit strange lands but to possess other eyes, to behold the universe through the eyes of another, of a hundred others, to behold the hundred universes that each of them beholds, that each of them is.</description>
	<lastBuildDate>Fri, 03 Sep 2010 13:27:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Arrrr</title>
		<link>http://pascalschulthess.de/arrrr/</link>
		<comments>http://pascalschulthess.de/arrrr/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 13:27:12 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Error]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=325</guid>
		<description><![CDATA[Now I remember this one very specific feeling when you find an error in one of the scripts. Not in some random script, noooo, this would be to easy. But rather in one of the most central algorithms I developed over the last year. One of the algorithms that is the basis for so many [...]]]></description>
			<content:encoded><![CDATA[<p>Now I remember this one very specific feeling when you find an error in one of the scripts. Not in some random script, noooo, this would be to easy. But rather in one of the most central algorithms I developed over the last year. One of the algorithms that is the basis for so many other scripts and results and figures and and and. Arrr. That&#8217;s exactly the way I want to start the weekend. NOT!</p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/arrrr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Call for Papers</title>
		<link>http://pascalschulthess.de/call-for-papers/</link>
		<comments>http://pascalschulthess.de/call-for-papers/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 20:31:56 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Leisure]]></category>
		<category><![CDATA[Ph.D. thesis]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=321</guid>
		<description><![CDATA[PHD Comics are just hilarious!]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.phdcomics.com/comics/archive/phd062510s.gif" alt="PHD Comics: Call for Papers" /></p>
<p><a href="http://www.phdcomics.com/">PHD Comics</a> are just hilarious!</p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/call-for-papers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Science on an Android</title>
		<link>http://pascalschulthess.de/science-on-an-android/</link>
		<comments>http://pascalschulthess.de/science-on-an-android/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 11:39:29 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/science-on-an-android/</guid>
		<description><![CDATA[Yesterday I received my new HTC Desire Android phone, and I have to say I pretty psyched to discover its possibilities. Of course I first had to look for any science apps. Sadly I found only three worth mentioning: Detexify: Just paint a symbol for which you want to know the LaTeX code on the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I received my new HTC Desire Android phone, and I have to say I pretty psyched to discover its possibilities. Of course I first had to look for any science apps. Sadly I found only three worth mentioning:</p>
<ul>
<li><strong>Detexify</strong>: Just paint a symbol for which you want to know the LaTeX code on the screen and let there be magic.</li>
<li><strong>HandyCalc</strong>: Best calculator out there. Let&#8217;s you even solve and plot equations and functions.</li>
<li><strong>PubMed Mobile</strong>: Search PubMed with using a browser.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/science-on-an-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deconvolution of nested cell arrays in Matlab</title>
		<link>http://pascalschulthess.de/deconvolution-of-nested-cell-arrays-in-matlab/</link>
		<comments>http://pascalschulthess.de/deconvolution-of-nested-cell-arrays-in-matlab/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 17:03:31 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Cell Array]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=261</guid>
		<description><![CDATA[Recently, I faced the problem of getting heavily nested cell arrays, and since there&#8217;s no built-in function to deconvolve such cell array, I had to find another solution. If you have a nested array nestedArray which is defined as nestedArray = &#123;&#123;'a','b'&#125;,'c'&#125;; and you want to flatten it in way that it looks like flatArray [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I faced the problem of getting heavily nested cell arrays, and since there&#8217;s no built-in function to deconvolve such cell array, I had to find another solution. </p>
<p>If you have a nested array <code>nestedArray</code> which is defined as</p>

<div class="wp_syntax"><div class="code"><pre class="scilab" style="font-family:monospace;">nestedArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'a'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'b'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'c'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>and you want to flatten it in way that it looks like</p>

<div class="wp_syntax"><div class="code"><pre class="scilab" style="font-family:monospace;">flatArray <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'a'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'b'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'c'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>you need to write a short function which looks like</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="scilab" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> flatArray <span style="color: #339933;">=</span> flattenCell<span style="color: #009900;">&#40;</span>nestedArray<span style="color: #009900;">&#41;</span>
  <span style="color: #000066;">error</span><span style="color: #009900;">&#40;</span>nargchk<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>nargin<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #339933;">~</span>iscell<span style="color: #009900;">&#40;</span>nestedArray<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #000066;">error</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Must be a cell array.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">end</span>
  flatArray<span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">for</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span>numel<span style="color: #009900;">&#40;</span>nestedArray<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #b1b100;">if</span> iscell<span style="color: #009900;">&#40;</span>nestedArray<span style="color: #009900;">&#123;</span>i<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      y <span style="color: #339933;">=</span> flattenCell<span style="color: #009900;">&#40;</span>nestedArray<span style="color: #009900;">&#123;</span>i<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#91;</span>flatArray<span style="color: #009900;">&#123;</span><span style="color: #b1b100;">end</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><span style="color: #b1b100;">end</span><span style="color: #339933;">+</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span>y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> deal<span style="color: #009900;">&#40;</span>y<span style="color: #009900;">&#123;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span>
      flatArray<span style="color: #009900;">&#123;</span><span style="color: #b1b100;">end</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> nestedArray<span style="color: #009900;">&#123;</span>i<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">end</span>
<span style="color: #b1b100;">end</span>
flatArray<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I found this beautiful piece of code in <a href="http://groups.google.com/group/comp.soft-sys.matlab/browse_thread/thread/83e6ad0772bf68b8/f3f364e0cba986c0">this post</a> in the <a href="http://groups.google.com/group/comp.soft-sys.matlab/topics">Matlab Usenet Group</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/deconvolution-of-nested-cell-arrays-in-matlab/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Get excited and make things</title>
		<link>http://pascalschulthess.de/get-excited-and-make-things/</link>
		<comments>http://pascalschulthess.de/get-excited-and-make-things/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 00:09:17 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Literature]]></category>
		<category><![CDATA[Ph.D. thesis]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=222</guid>
		<description><![CDATA[It&#8217;s tough learning the ropes in such a complex field. There are hundreds of papers to read, thousands of terms to understand and dozen of experimental methods to a least recognize. The last couple of days and weeks I spend time with reading papers which where mostly describing experiments. Note, that I&#8217;m a theoretician and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://pascalschulthess.de/wp-content/uploads/get_excited_and_make_things.jpg" alt="Get excited and make things" title="Get excited and make things" width="600" height="262" class="alignleft size-full wp-image-224" /><br />
It&#8217;s tough learning the ropes in such a complex field. There are hundreds of papers to read, thousands of terms to understand and dozen of experimental methods to a least recognize. The last couple of days and weeks I spend time with reading papers which where mostly describing experiments. Note, that I&#8217;m a theoretician and that I had no idea what Western Blots etc. are. Now I&#8217;m a teeny-weeny bit more familiar with all that experimental stuff, although I&#8217;ve read at least ten papers about it.<br />
But, now it&#8217;s about time to get things started. One theoretical paper later, there are multiple ideas buzzing around, which could easily result in more than month of programming, analyzing and interpreting.</p>
<p>I&#8217;m excited and look forward to make things.</p>
<p><small>[Image by <a href="http://www.flickr.com/photos/blackbeltjones/">moleitau</a>]</small></p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/get-excited-and-make-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First snow</title>
		<link>http://pascalschulthess.de/first-snow/</link>
		<comments>http://pascalschulthess.de/first-snow/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 17:42:13 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Berlin]]></category>
		<category><![CDATA[Cafeteria]]></category>
		<category><![CDATA[Snow]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=201</guid>
		<description><![CDATA[It was quite nice today. Sitting in the cafeteria, looking outside and witnessing the first snow of this winter falling down on Berlin. That was the second time I realized that I will feel at ease with living in Berlin and working at the university. Even in the winter, although everybody says that Berlin&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="" src="http://farm1.static.flickr.com/105/301794976_e6cb23a3e4_o.jpg" title="Bahndamm" class="aligncenter" width="600" /></p>
<p>It was quite nice today. Sitting in the cafeteria, looking outside and witnessing the first snow of this winter falling down on Berlin. That was the second time I realized that I will feel at ease with living in Berlin and working at the university. Even in the winter, although everybody says that Berlin&#8217;s not nice during this gray and cold time of the year. But I like returning home from the university in the dark, walking through the rain and a brightly lit streets, feeling the wind that always blows in the city.</p>
<p><small>[Image by <a href="http://www.flickr.com/photos/pink_dispatcher/">Pink Dispatcher</a>]</small></p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/first-snow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Papers &#8211; literature management</title>
		<link>http://pascalschulthess.de/papers-literature-management/</link>
		<comments>http://pascalschulthess.de/papers-literature-management/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 17:32:53 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Bibliography]]></category>
		<category><![CDATA[BibTeX]]></category>
		<category><![CDATA[Google Scholar]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod Touch]]></category>
		<category><![CDATA[Literature]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[PubMed]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=178</guid>
		<description><![CDATA[So, what are the first things when you start a new job? Right, prepare your computer in a way that the upcoming work runs as smooth as possible. This process calls for even much more time if you have to get familiar with a totally new operating system. Fortunately, the operating systems coming from Apple [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://pascalschulthess.de/wp-content/uploads/papers-300x225.jpg" alt="Papers Logo" title="Papers Logo" width="200" height="150" class="alignleft size-medium wp-image-179" />So, what are the first things when you start a new job? Right, prepare your computer in a way that the upcoming work runs as smooth as possible. This process calls for even much more time if you have to get familiar with a totally new operating system. Fortunately, the operating systems coming from Apple are really really really easy to learn and understand. But, of cause, you need to &#8220;learn&#8221; new programs too. And if you&#8217;re lucky, these programs even do the job a little bit better than the ones you used to use. After a couple of weeks I really didn&#8217;t stumbled over outstanding Mac software. Ok, everything was a little more &#8220;stylish&#8221; than on my Ubuntu machine, but that&#8217;s pretty much it. In fact, Ubuntu is in many ways much more  geek-friendly.<br />
But, the exception proves the rule. For every researcher, the program for managing papers and other literature is quite important. I was used to the way, the ordinary bibliography managing tool has be operated. First you have to search for a paper via <a href="http://scholar.google.com">Google Scholar</a> or <a href="http://www.ncbi.nlm.nih.gov/sites/entrez?db=PubMed">PubMed</a>. Secondly you either have to insert all the meta data of an article by hand or copy the BibTeX code in your program. At this point you haven&#8217;t downloaded the paper yet.<br />
But this whole procedure changes and consumes much less time now with the incredible <a href="http://mekentosj.com/papers/">Papers</a>. I really haven&#8217;t seen a piece of software which does the job so well. In the following I&#8217;d like to list a few of its features.</p>
<ul>
<li>Search article repositories and download articles without leaving Papers</li>
<li>Papers lets you view, browse and search your library, iTunes style</li>
<li>Ease the pain of organizing and naming files on your hard drive with Papers&#8217; automatic management</li>
<li>Collect your articles together or create smart groups that are always up to date</li>
<li>Browse your library by author or journal, and check for recent articles you don&#8217;t yet have</li>
<li>&#8230;</li>
</ul>
<p>Well, if you&#8217;d like to use Papers you have to pay a couple of bugs but it&#8217;s definitely worth it. By automating nearly every process in literature management, you gain time to actually read all the stuff. And there&#8217;s even an iPhone/iPod Touch App to take your literature with you wherever you go.</p>
<p><a href="http://mekentosj.com/papers/">Papers &#8211; Website</a></p>
<p><small>No, I wasn&#8217;t paid from anybody to write this post. I only wanted to share my happiness that there actually <em>is</em> quite good software out there for literature management.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/papers-literature-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logarithmic Plot with two y-axes in Mathematica</title>
		<link>http://pascalschulthess.de/logarithmic-plot-with-two-y-axes-in-mathematica/</link>
		<comments>http://pascalschulthess.de/logarithmic-plot-with-two-y-axes-in-mathematica/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 20:50:00 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Logarithm]]></category>
		<category><![CDATA[Mathematica]]></category>
		<category><![CDATA[Plot]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=116</guid>
		<description><![CDATA[Since there is no built-in Mathematica 6.0 function to generate a plot with two linear y-axes and a logarithmic x-axis, I found the following method which fulfilled my needs. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 TwoAxisListLogPlot[f_List, g_List, frange_, grange_, color1_, color2_, opts___?OptionQ] := Module[{old, [...]]]></description>
			<content:encoded><![CDATA[<p>Since there is no built-in Mathematica 6.0 function to generate a plot with two linear y-axes and a logarithmic x-axis, I found the following method which fulfilled my needs.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="mathematica" style="font-family:monospace;">TwoAxisListLogPlot[f_List, g_List, frange_, grange_, color1_, color2_,
   opts___?OptionQ] := 
 Module[{old, new, scale, fm, fM, gm, gM, newg}, {fm, fM} = frange;
  {gm, gM} = grange;
  scale[var_] := ((var - gm) (fM - fm))/(gM - gm) + fm;
  old = AbsoluteOptions[
     ListPlot[g, Frame -&gt; True, PlotRange -&gt; grange, 
      DisplayFunction -&gt; Identity], FrameTicks][[1, 2, 2]];
  new = (Prepend[Rest[#1], scale[First[#1]]] &amp;) /@ old;
  newg = 
   Transpose[{Transpose[g][[1]], 
     Map[scale, Transpose[g][[2]], {1, 2}]}];
  ListLogLinearPlot[{f, newg}, Frame -&gt; True, 
   FrameTicks -&gt; {Automatic, Automatic, None, new}, 
   PlotStyle -&gt; {{color1}, {color2}}, 
   FrameStyle -&gt; {{}, {color1}, {}, {color2}}, 
   PlotRange -&gt; frange*(1 + .00 (fM - fm)), opts]]</pre></td></tr></table></div>

<p>This defines the new function <code>TwoAxisListLogPlot</code>. The usage of this new function is:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="mathematica" style="font-family:monospace;">Labeled[Labeled[
  TwoAxisListPlot[data1, data2, {5, 8.3}, {450, 460}, Red, Blue, 
   Axes -&gt; False, Joined -&gt; {True, False}, 
   PlotMarkers -&gt; {Style[\[EmptyCircle], Red, Medium, 
      Background -&gt; White], 
     Style[\[FilledUpTriangle], Blue, Medium]}], {Style[&quot;X&quot;, 
    FontFamily -&gt; Times], 
   Style[&quot;Y&quot;, Red, FontFamily -&gt; Times]}, {Bottom, Left}], 
 Style[&quot;Y-alt&quot;, Blue, FontFamily -&gt; Times], Right]</pre></td></tr></table></div>

<p>where <code>data1</code> and <code>data2</code> represent the two datasets, obviously. The resulting plot looks like this:<br />
<img src="http://pascalschulthess.de/wp-content/uploads/plot.png" alt="ListLogLinearPlot with two y-axes" title="ListLogLinearPlot with two y-axes" width="415" height="240" class="aligncenter size-full wp-image-120" /></p>
<p>It is also possible to do a double logarithmic plot by changing <code>ListLogLinearPlot</code> in line 13 into <code>ListLogLogPlot</code>.<br />
A running Mathematica example can be found in the <a href="http://pascalschulthess.de/repository/">repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/logarithmic-plot-with-two-y-axes-in-mathematica/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inkscape and textext: Deprecation Warning</title>
		<link>http://pascalschulthess.de/inkscape-and-textext-deprecation-warning/</link>
		<comments>http://pascalschulthess.de/inkscape-and-textext-deprecation-warning/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 19:20:01 +0000</pubDate>
		<dc:creator>Pascal Schulthess</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Bug]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://pascalschulthess.de/?p=98</guid>
		<description><![CDATA[I just came across the following error of textext in Inkscape. ~/.inkscape/extensions/textext.py:55: DeprecationWarning: the md5 module is deprecated; use hashlib instead import os, sys, tempfile, traceback, glob, re, md5, copy This error arises for textext 0.4.4., Inkscape 0.46 and Python 2.6.2. Fortunately I found a solution at bitbucket. But since I had some problems understanding [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across the following error of <a href="http://www.elisanet.fi/ptvirtan/software/textext/">textext</a> in <a href="http://www.inkscape.org/">Inkscape</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">~/.<span style="color: black;">inkscape</span>/extensions/textext.<span style="color: black;">py</span>:<span style="color: #ff4500;">55</span>: <span style="color: #008000;">DeprecationWarning</span>: 
the <span style="color: #dc143c;">md5</span> module <span style="color: #ff7700;font-weight:bold;">is</span> deprecated<span style="color: #66cc66;">;</span> use hashlib instead
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">tempfile</span>, <span style="color: #dc143c;">traceback</span>, <span style="color: #dc143c;">glob</span>, <span style="color: #dc143c;">re</span>, <span style="color: #dc143c;">md5</span>, <span style="color: #dc143c;">copy</span></pre></div></div>

<p>This error arises for textext 0.4.4., Inkscape 0.46 and Python 2.6.2. Fortunately I found a solution at <a href="http://bitbucket.org/pv/textext/issue/1/module-md5-deprecated-in-python-26">bitbucket</a>. But since I had some problems understanding how to change the python file, I will help you out with a detailed how-to.</p>
<p>Open the <code>textext.py</code> file mentioned in the error message with an editor of your choice. Now change the the lines</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>54
55
56
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> inkex
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">tempfile</span>, <span style="color: #dc143c;">traceback</span>, <span style="color: #dc143c;">glob</span>, <span style="color: #dc143c;">re</span>, <span style="color: #dc143c;">md5</span>, <span style="color: #dc143c;">copy</span>
<span style="color: #ff7700;font-weight:bold;">from</span> lxml <span style="color: #ff7700;font-weight:bold;">import</span> etree</pre></td></tr></table></div>

<p>into</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>54
55
56
57
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> inkex
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>, <span style="color: #dc143c;">sys</span>, <span style="color: #dc143c;">tempfile</span>, <span style="color: #dc143c;">traceback</span>, <span style="color: #dc143c;">glob</span>, <span style="color: #dc143c;">re</span>, <span style="color: #dc143c;">copy</span>
<span style="color: #ff7700;font-weight:bold;">import</span> hashlib
<span style="color: #ff7700;font-weight:bold;">from</span> lxml <span style="color: #ff7700;font-weight:bold;">import</span> etree</pre></td></tr></table></div>

<p>Furthermore change</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>868
869
870
871
872
873
874
875
876
877
878
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, document<span style="color: black;">&#41;</span>:
        PdfConverterBase.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, document<span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: #008000;">hash</span> = <span style="color: #008000;">None</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> convert<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>a, <span style="color: #66cc66;">**</span>kw<span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># compute hash for generating unique ids for sub-elements</span>
        <span style="color: #008000;">self</span>.<span style="color: #008000;">hash</span> = <span style="color: #dc143c;">md5</span>.<span style="color: #dc143c;">new</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%s%s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>a, kw<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">hexdigest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>:<span style="color: #ff4500;">8</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> PdfConverterBase.<span style="color: black;">convert</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>a, <span style="color: #66cc66;">**</span>kw<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> pdf_to_svg<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        exec_command<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'pdf2svg'</span>, <span style="color: #008000;">self</span>.<span style="color: black;">tmp</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'pdf'</span><span style="color: black;">&#41;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">tmp</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'svg'</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">'1'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>into</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>868
869
870
871
872
873
874
875
876
877
878
879
880
881
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, document<span style="color: black;">&#41;</span>:
        PdfConverterBase.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, document<span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: #008000;">hash</span> = <span style="color: #008000;">None</span>
        USE_GTK = <span style="color: #008000;">False</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> convert<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>a, <span style="color: #66cc66;">**</span>kw<span style="color: black;">&#41;</span>:
        <span style="color: #808080; font-style: italic;"># compute hash for generating unique ids for sub-elements</span>
        m = hashlib.<span style="color: #dc143c;">md5</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        m.<span style="color: black;">update</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%s%s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>a, kw<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: #008000;">hash</span> = m.<span style="color: black;">hexdigest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>:<span style="color: #ff4500;">8</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> PdfConverterBase.<span style="color: black;">convert</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>a, <span style="color: #66cc66;">**</span>kw<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> pdf_to_svg<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        exec_command<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'pdf2svg'</span>, <span style="color: #008000;">self</span>.<span style="color: black;">tmp</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'pdf'</span><span style="color: black;">&#41;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">tmp</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'svg'</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">'1'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>That&#8217;s it. Restart Inkscape and you&#8217;re done.</p>
<p>Happy TeXing</p>
]]></content:encoded>
			<wfw:commentRss>http://pascalschulthess.de/inkscape-and-textext-deprecation-warning/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
