<?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>from the desk of stinkpot</title>
	<atom:link href="http://desk.stinkpot.org/tricks/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://desk.stinkpot.org:8080/tricks</link>
	<description>tricks!</description>
	<lastBuildDate>Thu, 17 May 2012 13:29:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>match tab in sed</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/05/match-tab-in-sed/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/05/match-tab-in-sed/#comments</comments>
		<pubDate>Thu, 17 May 2012 13:07:38 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=439</guid>
		<description><![CDATA[to replace a tab in sed: sed &#8216;s/&#60;tab&#62;//&#8217; where &#60;tab&#62; is you typing CTRL-V followed by pressing TAB (thanks to atoztoa!). alternatively: sed &#8216;s/\\\t//&#8217; &#160;]]></description>
			<content:encoded><![CDATA[<p>to replace a tab in sed:</p>
<blockquote><p>sed &#8216;s/&lt;tab&gt;//&#8217;</p></blockquote>
<p>where &lt;tab&gt; is you typing CTRL-V followed by pressing TAB (thanks to <a href="http://www.atoztoa.com/2008/12/replace-tab-using-sed.html">atoztoa</a>!).</p>
<p>alternatively:</p>
<blockquote><p>sed &#8216;s/\\\t//&#8217;</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/05/match-tab-in-sed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>use csv to write out data in python</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/03/use-csv-to-write-out-data-in-python/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/03/use-csv-to-write-out-data-in-python/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 19:46:30 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=437</guid>
		<description><![CDATA[the csv module is a helpful module for writing out data in python. here&#8217;s how to write out data: import csv &#8230;. color_l = ['red','green','blue'] text_l = ['roses','turtles','water'] color_f = open(foo.bar,&#8217;w') header_l=['text','color'] csv_o = csv.DictWriter(color_f,delimiter=&#8217;;',fieldnames=header_l) csv_o.writeheader() row_l = [{'text':a,'color':b} for a,b in zip(text_l,color_l)] csv_o.writerows(row_l) color_f.close()]]></description>
			<content:encoded><![CDATA[<p>the csv module is a helpful module for writing out data in python.</p>
<p>here&#8217;s how to write out data:</p>
<blockquote><p>import csv</p>
<p>&#8230;.</p>
<p>color_l = ['red','green','blue']<br />
text_l = ['roses','turtles','water']<br />
color_f = open(foo.bar,&#8217;w')<br />
header_l=['text','color']<br />
csv_o = csv.DictWriter(color_f,delimiter=&#8217;;',fieldnames=header_l)<br />
csv_o.writeheader()<br />
row_l = [{'text':a,'color':b} for a,b in zip(text_l,color_l)]<br />
csv_o.writerows(row_l)<br />
color_f.close()</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/03/use-csv-to-write-out-data-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ftp problems with wordpress automatic update</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/03/ftp-problems-with-wordpress-automatic-update/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/03/ftp-problems-with-wordpress-automatic-update/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 05:00:38 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Webserver]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=431</guid>
		<description><![CDATA[i was getting this error: &#8220;There was an error connecting to the server, Please verify the settings are correct.&#8221; when trying to use wordpress&#8217; automatic update function. turns out the problem was that my ftp server was disallowing local connections. to fix, i had to uncomment the line: &#8220;local_enable=YES&#8221; from /etc/vsftpd.conf and restart the vsftpd [...]]]></description>
			<content:encoded><![CDATA[<p>i was getting this error: &#8220;There was an error connecting to the server, Please verify the settings are correct.&#8221; when trying to use wordpress&#8217; automatic update function.</p>
<p>turns out the problem was that my ftp server was disallowing local connections.</p>
<p>to fix, i had to uncomment the line: &#8220;local_enable=YES&#8221; from /etc/vsftpd.conf and restart the vsftpd server.</p>
<p>then, i noticed a new problem while updating: &#8220;Could not create directory.&#8221;</p>
<p>the solution: uncomment &#8220;write_enable=YES&#8221; from /etc/vsftpd.conf and restart again.</p>
<p>finally, i eliminated &#8220;Could not copy files.&#8221; errors by chown&#8217;ing all files and directories in my wordpress directory to be owned by the ftp user specified in the update login.</p>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/03/ftp-problems-with-wordpress-automatic-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hide the axis frame in matplotlib</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/hide-the-axis-frame-in-matplotlib/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/hide-the-axis-frame-in-matplotlib/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 22:03:58 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=429</guid>
		<description><![CDATA[to hide the axis bordering a figure: fig, ax = pylab.subplots() ax.set_frame_on(False) &#160;]]></description>
			<content:encoded><![CDATA[<p>to hide the axis bordering a figure:</p>
<blockquote><p>fig, ax = pylab.subplots()</p>
<p>ax.set_frame_on(False)</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/hide-the-axis-frame-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>remove axis labels in matplotlib</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/remove-axis-labels-in-matplotlib/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/remove-axis-labels-in-matplotlib/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 22:02:57 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=427</guid>
		<description><![CDATA[to remove the labels of the x-axis: ax.get_xaxis().set_ticks([]) to remove the labels of the y-axis: ax.get_yaxis().set_ticks([])]]></description>
			<content:encoded><![CDATA[<p>to remove the labels of the x-axis:</p>
<blockquote><p>ax.get_xaxis().set_ticks([])</p></blockquote>
<p>to remove the labels of the y-axis:</p>
<blockquote><p>ax.get_yaxis().set_ticks([])</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/remove-axis-labels-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hide tick lines in matplotlib</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/hide-tick-lines-in-matplotlib/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/hide-tick-lines-in-matplotlib/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 03:41:49 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=425</guid>
		<description><![CDATA[to hide the tick lines in matplotlib: xaxis = ax.xaxis xaxis.set_ticks_position(&#8216;none&#8217;)]]></description>
			<content:encoded><![CDATA[<p>to hide the tick lines in matplotlib:</p>
<blockquote><p>xaxis = ax.xaxis</p>
<p>xaxis.set_ticks_position(&#8216;none&#8217;)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/hide-tick-lines-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>horizontal grid lines in matplotlib</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/horizontal-grid-lines-in-matplotlib/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/horizontal-grid-lines-in-matplotlib/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 01:20:23 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=423</guid>
		<description><![CDATA[to create only horizontal grid lines in matplotlib: fig, ax = pylab.subplots(1) ax.xaxis.grid(True) pylab.grid()]]></description>
			<content:encoded><![CDATA[<p>to create only horizontal grid lines in matplotlib:</p>
<blockquote><p>fig, ax = pylab.subplots(1)</p>
<p>ax.xaxis.grid(True)</p>
<p>pylab.grid()</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/02/horizontal-grid-lines-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>label x-axis with strings, instead of numbers, in matplotlib</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2012/01/label-x-axis-with-strings-instead-of-numbers-in-matplotlib/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2012/01/label-x-axis-with-strings-instead-of-numbers-in-matplotlib/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 16:14:57 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=421</guid>
		<description><![CDATA[let&#8217;s say you&#8217;ve made a bar plot and you want to label the bars by strings (e.g. &#8216;A&#8217;, &#8216;B&#8217;) instead of the default number range.  to do with a list of labels named &#8216;bar_l&#8217;: import pylab as pl pl.xticks(np.arange(len(bar_l)),bar_l,rotation=45)]]></description>
			<content:encoded><![CDATA[<p>let&#8217;s say you&#8217;ve made a bar plot and you want to label the bars by strings (e.g. &#8216;A&#8217;, &#8216;B&#8217;) instead of the default number range.  to do with a list of labels named &#8216;bar_l&#8217;:</p>
<blockquote><p>import pylab as pl</p>
<p>pl.xticks(np.arange(len(bar_l)),bar_l,rotation=45)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2012/01/label-x-axis-with-strings-instead-of-numbers-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>change default line color order in matplotlib</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2011/09/change-default-line-color-order-in-matplotlib/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2011/09/change-default-line-color-order-in-matplotlib/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 03:07:27 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=417</guid>
		<description><![CDATA[to change the default line color order (color cycle in matplotlib-speak): ax.set_color_cycle(['green', 'orange', 'blue', 'red','brown','pink']) note that this will also go ahead and reset the line counter.]]></description>
			<content:encoded><![CDATA[<p>to change the default line color order (color cycle in matplotlib-speak):</p>
<blockquote><p>ax.set_color_cycle(['green', 'orange', 'blue', 'red','brown','pink'])</p></blockquote>
<p>note that this will also go ahead and reset the line counter.</p>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2011/09/change-default-line-color-order-in-matplotlib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>draw fill_between matplotlib plot with nans</title>
		<link>http://desk.stinkpot.org:8080/tricks/index.php/2011/09/draw-fill_between-matplotlib-plot-with-nans/</link>
		<comments>http://desk.stinkpot.org:8080/tricks/index.php/2011/09/draw-fill_between-matplotlib-plot-with-nans/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 20:05:59 +0000</pubDate>
		<dc:creator>Lawrence David</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://desk.stinkpot.org:8080/tricks/?p=415</guid>
		<description><![CDATA[nan&#8217;s cause problems with the fill_between plots in matplotlib. to fix, use the &#8220;where&#8221; input argument: fig, ax = pl.subplots(1) ax.fill_between(x_v,0,y_v,where=np.isfinite(y_v))]]></description>
			<content:encoded><![CDATA[<p>nan&#8217;s cause problems with the fill_between plots in matplotlib.</p>
<p>to fix, use the &#8220;where&#8221; input argument:</p>
<blockquote><p>fig, ax = pl.subplots(1)</p>
<p>ax.fill_between(x_v,0,y_v,where=np.isfinite(y_v))</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://desk.stinkpot.org:8080/tricks/index.php/2011/09/draw-fill_between-matplotlib-plot-with-nans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

