<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>z·eeki·sh</title>
	<atom:link href="http://zeekish.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zeekish.wordpress.com</link>
	<description>tech log on gentoo, linux, and random stuff</description>
	<lastBuildDate>Wed, 04 Jan 2012 23:19:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zeekish.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>z·eeki·sh</title>
		<link>http://zeekish.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zeekish.wordpress.com/osd.xml" title="z·eeki·sh" />
	<atom:link rel='hub' href='http://zeekish.wordpress.com/?pushpress=hub'/>
		<item>
		<title>stripping url output from bibtex</title>
		<link>http://zeekish.wordpress.com/2012/01/04/stripping-url-output-from-bibtex/</link>
		<comments>http://zeekish.wordpress.com/2012/01/04/stripping-url-output-from-bibtex/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 23:19:26 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/etc]]></category>
		<category><![CDATA[bbl]]></category>
		<category><![CDATA[bibtex]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=278</guid>
		<description><![CDATA[The bibliographical information as supplied by journals usually includes a URL field, and bibtex styles like \bibliographystyle{apsrev} will export the URL field in the resulting .bbl file, very nagging to some of us. One way to get rid of these URL links is to use a customized .bst file, e.g., locate apsrev to find where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=278&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The bibliographical information as supplied by journals usually includes a URL field, and bibtex styles like <code>\bibliographystyle{apsrev}</code> will export the URL field in the resulting <code>.bbl</code> file, very nagging to some of us. One way to get rid of these URL links is to use a customized <code>.bst</code> file, e.g.,
<ol>
<li><code>locate apsrev</code> to find where the <code>apsrev.bst</code> file is.</li>
<li>cd to the directory, and invoke <code>grep -v 'format.url output' apsrev.bst &gt; your/manuscript/directory/apsrev-no-url.bst</code> to create a no-url version of the bst file in your manuscript directory (or any other directory in the search path of bibtex).</li>
<li>now, in your manuscript, replace <code>\bibliographystyle{apsrev}</code> with <code>\bibliographystyle{apsrev-no-url}</code></li>
</ol>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/etc/'>/etc</a> Tagged: <a href='http://zeekish.wordpress.com/tag/bbl/'>bbl</a>, <a href='http://zeekish.wordpress.com/tag/bibtex/'>bibtex</a>, <a href='http://zeekish.wordpress.com/tag/latex/'>latex</a>, <a href='http://zeekish.wordpress.com/tag/url/'>url</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=278&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2012/01/04/stripping-url-output-from-bibtex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>pdf to gif conversion and optimization</title>
		<link>http://zeekish.wordpress.com/2011/09/14/pdf-to-gif-conversion-and-optimization/</link>
		<comments>http://zeekish.wordpress.com/2011/09/14/pdf-to-gif-conversion-and-optimization/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 07:06:13 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/etc]]></category>
		<category><![CDATA[/usr/local/bin]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[gifsicle]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=258</guid>
		<description><![CDATA[There have been several occasions that I need to generate some gif animations from a bunch of pdf plots (generated by gnuplot&#8217;s tikz terminal), so the following procedure merits documenting. Note that convert is part of ImageMagick, and gifsicle is a gif optimization tool. Converting pdfs to png: for f in *pdf; do convert -verbose [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=258&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There have been several occasions that I need to generate some gif animations from a bunch of pdf plots (generated by gnuplot&#8217;s tikz terminal), so the following procedure merits documenting. Note that <tt>convert</tt> is part of ImageMagick, and <tt>gifsicle</tt> is a gif optimization tool.</p>
<ol>
<li>Converting pdfs to png:<br />
<tt>for f in *pdf; do convert -verbose -density 150x150 $f `basename $f .pdf`.png; done</tt></li>
<li>combining png to gif (and optimize):<br />
<tt>convert -verbose +dither -layers Optimize -colors 32 -delay 5 -loop 0 -dispose previous *png output.gif</tt></li>
<ul>
<li>if there are too many *png files, it&#8217;s probably better to divide and conquerer: assuming png files are frame_000 upto frame_139, then first:<br />
<tt>for i in `seq -f "%02g" 0 13`; do convert -verbose +dither -layer Optimize -delay 5 -loop 0 -dispose previous frame_${f}?.png frame_${f}.gif; done</tt><br />
then<br />
<tt>convert -verbose frame_??.gif all.gif</tt></li>
<li>notice that I&#8217;ve dropped the <tt>-color 32</tt>, b/c in my case it actually increases the resulting file size.</li>
</ul>
<li>further optimization (YMMV) using gifsicle:<br />
gifsicle -O3 output.gif -o output_optimized.gif</li>
</ol>
<p>cf:</p>
<p>http://www.wizards-toolkit.org/discourse-server/viewtopic.php?f=1&#038;t=13339&#038;start=15&#038;sid=10c87c23bbac068a5eb44654da33167f</p>
<hr />
<p>p.s., a related operation is to combine say every 10th of the pdfs for closeup inspection:</p>
<p><tt>pdfjam frame_??0.pdf --papersize '{12in,9in}' --outfile frames.pdf</tt></p>
<p><tt>pdfjam<tt> is a frontend to the latex package "pdfpages". The <tt>--papersize</tt> I used is the same as the one I had used in gnuplot when generating these plots (<tt>set term tikz size 12in,9in ...</tt>).</tt></tt></p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/etc/'>/etc</a>, <a href='http://zeekish.wordpress.com/category/usrlocalbin/'>/usr/local/bin</a> Tagged: <a href='http://zeekish.wordpress.com/tag/convert/'>convert</a>, <a href='http://zeekish.wordpress.com/tag/gif/'>gif</a>, <a href='http://zeekish.wordpress.com/tag/gifsicle/'>gifsicle</a>, <a href='http://zeekish.wordpress.com/tag/gnuplot/'>gnuplot</a>, <a href='http://zeekish.wordpress.com/tag/imagemagick/'>ImageMagick</a>, <a href='http://zeekish.wordpress.com/tag/optimization/'>optimization</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=258&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2011/09/14/pdf-to-gif-conversion-and-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>armadillo, lapack, and intel&#8217;s MKL</title>
		<link>http://zeekish.wordpress.com/2011/03/31/armadillo-lapack-and-intels-mkl/</link>
		<comments>http://zeekish.wordpress.com/2011/03/31/armadillo-lapack-and-intels-mkl/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 06:41:14 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/etc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[armadillo]]></category>
		<category><![CDATA[blas]]></category>
		<category><![CDATA[gsl]]></category>
		<category><![CDATA[lapack]]></category>
		<category><![CDATA[mkl]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=236</guid>
		<description><![CDATA[I normally use ruby/gsl for everyday numerics because it&#8217;s fast to code and extend, and semantically clear, plus you can do cool things like previewing energy spectrum from within irb by interfacing with the gnuplot module&#8212;normally you&#8217;d write to a tmp file, switch to gnuplot console, and plot it there. The problem with rb/gsl is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=236&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I normally use ruby/gsl for everyday numerics because it&#8217;s fast to code and extend, and semantically clear, plus you can do cool things like previewing energy spectrum from within irb by interfacing with the gnuplot module&#8212;normally you&#8217;d write to a tmp file, switch to gnuplot console, and plot it there.</p>
<p>The problem with rb/gsl is speed. The other day, my boss walked in and compiled his fortran code on my machine. It beat my ruby code hands-down&#8212;one would think gsl, being a C library, should be on par with lapack, but apparently it&#8217;s not, and it&#8217;s not (entirely) ruby&#8217;s fault since I rewrote the same stuff in C, using gsl, and it&#8217;s still about 4 times slower than my boss&#8217;s fortran code using lapack. (I guess partly it&#8217;s b/c gsl is using its own blas implementation).</p>
<p>So I want something faster but still with natural semantics&#8212;e.g., matrix multiplication should be <tt>A*B</tt>, not <tt>dgremm(...A...B...)</tt>&#8212;so C++ seems a reasonable place to look at. So far I find <a href="http://arma.sourceforge.net">armadillo</a> suits my needs quite well.  It is a c++ linear algebra library interfacing with lapack/blas.</p>
<p>On gentoo, this is what one needs:</p>
<ol>
<li>If you have intel cpu, emerge <tt>sci-libs/mkl</tt>. This is a blas/lapack drop-in replacement from Intel. You need to go to intel&#8217;s website and register (free) for a non-commercial usage license. AMD has a similar library. Otherwise, just setup your blas/lapack of choice.
<li>use <tt>eselect blas/cblas/lapack list/set</tt> to choose mkl as the blas/lapack implementation to use.
<li>now emerge <tt>sci-libs/armadillo</tt>. It is important to install it after 1) and 2) b/c it will decide what library it&#8217;s linking against during compilation time
</ol>
<p>Now, <tt>#include &lt;armadillo&gt;</tt> in your cpp code, and use<br />
<code>g++ -O3 -larmadillo your_code.cpp -o your_exe</code><br />
to compile. You don&#8217;t have to use <tt>-lblas -llapack</tt> as these are already taken care of by <tt>-larmadillo</tt> (which was done in 3 above, that&#8217;s why emerge order is important).</p>
<p>On a Mac OS X (my office workstation), the appropriate way to compile is instead:<br />
<code>g++ -O3 -framework Accelerate your_code.cpp -o your_exe</code><br />
as per armadillo&#8217;s readme file.</p>
<p>I transcribed my ruby/gsl code into c++/armadillo, and on the Mac, it actually is 2 times faster than my boss&#8217;s fortran code&#8212;since both are using the same underlying blas/lapack implementation, I suppose there&#8217;s some unnecessary computation in the fortran code. At any rate, it seems safe to say the c++ overhead is not significant so I&#8217;ll happily settle for armadillo for the moment.</p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/etc/'>/etc</a>, <a href='http://zeekish.wordpress.com/category/gentoo/'>gentoo</a> Tagged: <a href='http://zeekish.wordpress.com/tag/armadillo/'>armadillo</a>, <a href='http://zeekish.wordpress.com/tag/blas/'>blas</a>, <a href='http://zeekish.wordpress.com/tag/gsl/'>gsl</a>, <a href='http://zeekish.wordpress.com/tag/lapack/'>lapack</a>, <a href='http://zeekish.wordpress.com/tag/mkl/'>mkl</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=236&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2011/03/31/armadillo-lapack-and-intels-mkl/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>latex-beamer presentation on dual display (laptop + projector)</title>
		<link>http://zeekish.wordpress.com/2011/03/18/latex-beamer-presentation-on-dual-display-laptop-projector/</link>
		<comments>http://zeekish.wordpress.com/2011/03/18/latex-beamer-presentation-on-dual-display-laptop-projector/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 07:51:43 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/etc]]></category>
		<category><![CDATA[acroread]]></category>
		<category><![CDATA[beamer]]></category>
		<category><![CDATA[dual-display]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[presenter-view]]></category>
		<category><![CDATA[projector]]></category>
		<category><![CDATA[xrandr]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=229</guid>
		<description><![CDATA[The latex-beamer class supports a \note{} macro where one can add notes/slide descriptions that can be hidden from the audience.Combined with the \setbeameroption{show notes on secondscreen} option (and the pgfpages package), each page in the resulting pdf file has the presentation slide and the notes slide placed side by side. Then one can set up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=229&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The latex-beamer class supports a <tt>\note{}</tt> macro where one can add notes/slide descriptions that can be hidden from the audience.Combined with the <tt>\setbeameroption{show notes on secondscreen}</tt> option (and the <tt>pgfpages</tt> package), each page in the resulting pdf file has the presentation slide and the notes slide placed side by side. Then one can set up a dual-display environment&#8212;laptop + projector being the scenario I&#8217;m interested in&#8212;so that the presentation slide will show up on the projector while the notes slide is on the laptop. The restrictions here are
<ol>
<li>the two displays better have the same resolution
<p>    There is a way around this, described <a href="http://www.tug.org/pracjourn/2010-1/dohmen/dohmen.pdf">here</a>, where essentially one sets up the projector to just reproduce part of the laptop screen, but I find the resulting image on the projector a bit too fuzzy.</p>
<li>The pdf viewer must be able to span the two displays in its presentation mode. Surprisingly my day-to-day choice of lightweight viewer, <tt>evince</tt>, doesn&#8217;t support this&#8212;instead it just spans a single display in its full screen mode. (I&#8217;m using <tt>xrandr</tt> for dual-display setup. more on that later). Luckily <tt>acroread</tt> behaves in the desired manner (with some caveat. see below)
</ol>
<p>Here&#8217;s the script I use to add a projector to the <b>right</b> of my laptop screen (i.e., right edge of laptop screen identified with left edge of the projector screen):<br />
<code><br />
xrandr --output LVDS1 --mode 1024x768 --primary<br />
# force use 1024x768 mode of the projector<br />
xrandr --output VGA1 --mode 1024x768 --right-of LVDS1 || (xrandr --addmode VGA1 1024x768 &amp;&amp; xrandr --output VGA1 --mode 1024x768 --right-of LVDS1)<br />
</code></p>
<p>Three things to note:
<ol>
<li>The reason why I put the projector on the right is because the window manager I use (<tt>awesome</tt>) automatically push all windows onto the left-most screen when a second screen is added, and you don&#8217;t want all your stuff to go up onto the projector&#8211;I&#8217;m sure there is a way to overcome this in <tt>awesome</tt> but I&#8217;m just too lazy.
<li>The <tt>--primary</tt> is also necessary, this tells <tt>xrandr</tt> to set the laptop screen (<tt>LVDS1</tt>) as the primary one. Why? Because when going into full screen mode, <tt>acroread</tt> aligns the top-left corner of your document to the top-left of the primary screen. If your projector ended up becoming the primary screen, your notes will be displayed on the projector instead of your slides (which is pushed outside the visible range).
<li>With the above layout, your beamer document should have notes frames placed on the left hand side, <tt>\setbeameroption{show notes on secondscreen=left}</tt>
</ol>
<p>For completeness, here is the script to shut off the projector output:<br />
<code><br />
xrandr --output VGA1 --off<br />
xrandr --output LVDS1 --auto<br />
</code></p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/etc/'>/etc</a> Tagged: <a href='http://zeekish.wordpress.com/tag/acroread/'>acroread</a>, <a href='http://zeekish.wordpress.com/tag/beamer/'>beamer</a>, <a href='http://zeekish.wordpress.com/tag/dual-display/'>dual-display</a>, <a href='http://zeekish.wordpress.com/tag/latex/'>latex</a>, <a href='http://zeekish.wordpress.com/tag/presentation/'>presentation</a>, <a href='http://zeekish.wordpress.com/tag/presenter-view/'>presenter-view</a>, <a href='http://zeekish.wordpress.com/tag/projector/'>projector</a>, <a href='http://zeekish.wordpress.com/tag/xrandr/'>xrandr</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=229&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2011/03/18/latex-beamer-presentation-on-dual-display-laptop-projector/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>TeX capacity exceeded</title>
		<link>http://zeekish.wordpress.com/2011/02/23/tex-capacity-exceeded/</link>
		<comments>http://zeekish.wordpress.com/2011/02/23/tex-capacity-exceeded/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 21:37:53 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/etc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[main memory size]]></category>
		<category><![CDATA[pdflatex]]></category>
		<category><![CDATA[tex]]></category>
		<category><![CDATA[tex capacity exceeded]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=225</guid>
		<description><![CDATA[After the discovery of gnuplot&#8217;s tikz term, I have been using it for most of the plots I send to my advisor. A very nagging problem though is that when the number of data points is big, pdflatex would complain about &#8220;TeX capacity exceeded, sorry [main memory size = xxxx]&#8221; and refuse to compile. Today [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=225&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After the discovery of gnuplot&#8217;s tikz term, I have been using it for most of the plots I send to my advisor. A very nagging problem though is that when the number of data points is big, pdflatex would complain about &#8220;TeX capacity exceeded, sorry [main memory size = xxxx]&#8221; and refuse to compile. Today it has just come to a point I can&#8217;t stand this any more, so I did some googling and found a solution. Now TeX is a very messy system with fmt, sty, cnf files all over the place, so be sure to backup anything you touch in case something goes wrong.</p>
<p>Here&#8217;s a web page from JadeTeX that pointed me in the right direction, http://jadetex.sourceforge.net/#index-div-d18e113. The following solution is based on this.</p>
<ol>
<li>make changes to texmf.cnf. You may want to use `locate texmf.cnf&#8217; to find where it is. Then in it, change `main_memory&#8217; from 3000000 to say 8000000</li>
<li>now regenerate latex.fmt for plain latex, or pdflatex.fmt for pdflatex. E.g., to recompile pdflatex.fmt:
<ol>
<li>find where &#8220;pdflatex.ini&#8221; is</li>
<li>cd to that path, then invoke &#8220;pdflatex -ini -progname=pdflatex pdflatex.ini&#8221;<br />
Notice that this is different from what&#8217;s in the JadeTeX webpage. You need to invoke &#8220;pdflatex&#8221; instead of &#8220;tex&#8221;</li>
<li>now find where the original &#8220;pdflatex.fmt&#8221; is, back it up, and copy the generated &#8220;pdflatex.fmt&#8221; to there</li>
</ol>
</li>
<li>to regenerate &#8220;latex.fmt&#8221;, use &#8220;latex -ini -progname=latex latex.ini</li>
</ol>
<hr />
Update@2011/06/08:</p>
<p>In gentoo, the proper way of fixing this once and for all is:</p>
<ol>
<li>Change the value of the corresponding field in file <tt>/etc/texmf/texmf.d/20sizes.cnf</tt>. This should persist through all future <tt>texlive</tt> upgrades.
<li>run <tt>texmf-update</tt> to regenerate the system-wide <tt>texmf.cnf</tt>
<li>run <tt>fmtutil-sys --all</tt> to regenerate the <tt>.fmt</tt> files
</ol>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/etc/'>/etc</a>, <a href='http://zeekish.wordpress.com/category/gentoo/'>gentoo</a> Tagged: <a href='http://zeekish.wordpress.com/tag/latex/'>latex</a>, <a href='http://zeekish.wordpress.com/tag/main-memory-size/'>main memory size</a>, <a href='http://zeekish.wordpress.com/tag/pdflatex/'>pdflatex</a>, <a href='http://zeekish.wordpress.com/tag/tex/'>tex</a>, <a href='http://zeekish.wordpress.com/tag/tex-capacity-exceeded/'>tex capacity exceeded</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=225&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2011/02/23/tex-capacity-exceeded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>firefox segfaults after zlib upgrade</title>
		<link>http://zeekish.wordpress.com/2011/02/05/firefox-segfaults-after-zlib-upgrade/</link>
		<comments>http://zeekish.wordpress.com/2011/02/05/firefox-segfaults-after-zlib-upgrade/#comments</comments>
		<pubDate>Sat, 05 Feb 2011 20:39:15 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[-ftree-vectorize]]></category>
		<category><![CDATA[-mstackrealign]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[segfault]]></category>
		<category><![CDATA[zlib]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=222</guid>
		<description><![CDATA[After some emerging, my firefox suddenly started segfaulting everytime. The worst part of a segfault is you don&#8217;t get anything useful out of it, no error message, etc. A backtrace in gdb shows the problem is from a recent upgrade of sys-libs/zlib, and google says it&#8217;s an old problem, and as usual, gentoo devs refuse [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=222&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After some emerging, my firefox suddenly started segfaulting everytime. The worst part of a segfault is you don&#8217;t get anything useful out of it, no error message, etc. A backtrace in gdb shows the problem is from a recent upgrade of <tt>sys-libs/zlib</tt>, and google says it&#8217;s <a>an old problem</a>, and as usual, gentoo devs refuse to fix it (maybe for a good reason, but who cares). </p>
<p>Some more googling brought me to <a href="http://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg274164.html">this gcc ML post</a>. The solution is simply to add <tt>-mstackrealign</tt> into your <tt>/etc/make.conf</tt>. Re-emerge zlib then solves the problem.</p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/gentoo/'>gentoo</a> Tagged: <a href='http://zeekish.wordpress.com/tag/ftree-vectorize/'>-ftree-vectorize</a>, <a href='http://zeekish.wordpress.com/tag/mstackrealign/'>-mstackrealign</a>, <a href='http://zeekish.wordpress.com/tag/firefox/'>firefox</a>, <a href='http://zeekish.wordpress.com/tag/gentoo/'>gentoo</a>, <a href='http://zeekish.wordpress.com/tag/segfault/'>segfault</a>, <a href='http://zeekish.wordpress.com/tag/zlib/'>zlib</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=222&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2011/02/05/firefox-segfaults-after-zlib-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>quick notes on using gnuplot&#8217;s lua terminal</title>
		<link>http://zeekish.wordpress.com/2011/01/22/quick-notes-on-using-gnuplots-lua-terminal/</link>
		<comments>http://zeekish.wordpress.com/2011/01/22/quick-notes-on-using-gnuplots-lua-terminal/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 19:50:10 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/usr/bin]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[luaterm]]></category>
		<category><![CDATA[tex]]></category>
		<category><![CDATA[tikz]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=219</guid>
		<description><![CDATA[In gnuplot, set term tikz fulldoc color solid createstyle set output 'tmp.tex' p x**2 tit '$x^2$' then in shell, pdflatex tmp.tex NB: (1) &#8216;createstyle&#8217; is crucial, otherwise tex will complain about missing &#8216;gnuplot-lua-tikz.sty&#8217;. This doesn&#8217;t seem to be mentioned in the first several google results (2) I have to comment out the &#8216;utf8x&#8217; package in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=219&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In gnuplot,<br />
<code><br />
set term tikz fulldoc color solid createstyle<br />
set output 'tmp.tex'<br />
p x**2 tit '$x^2$'<br />
</code><br />
then in shell,<br />
<code><br />
pdflatex tmp.tex<br />
</code></p>
<p>NB:<br />
(1) &#8216;createstyle&#8217; is crucial, otherwise tex will complain about missing &#8216;gnuplot-lua-tikz.sty&#8217;. This doesn&#8217;t seem to be mentioned in the first several google results<br />
(2) I have to comment out the &#8216;utf8x&#8217; package in the resulting tmp.tex. That may just be a problem with my tex environment</p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/usrbin/'>/usr/bin</a> Tagged: <a href='http://zeekish.wordpress.com/tag/gnuplot/'>gnuplot</a>, <a href='http://zeekish.wordpress.com/tag/luaterm/'>luaterm</a>, <a href='http://zeekish.wordpress.com/tag/tex/'>tex</a>, <a href='http://zeekish.wordpress.com/tag/tikz/'>tikz</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=219&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2011/01/22/quick-notes-on-using-gnuplots-lua-terminal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>migrating gentoo to a new partition</title>
		<link>http://zeekish.wordpress.com/2010/12/05/migrating-gentoo-to-a-new-partition/</link>
		<comments>http://zeekish.wordpress.com/2010/12/05/migrating-gentoo-to-a-new-partition/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 03:28:06 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[/dev/console]]></category>
		<category><![CDATA[/dev/null]]></category>
		<category><![CDATA[unable to open an initial console]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=212</guid>
		<description><![CDATA[quick note to myself, copy with caution.. mkfs.ext4 /dev/sda2 mount /dev/sda2 /mnt/newgentoo cp -xavv / /mnt/newgentoo/ # -x is used b/c I have some dirs as mount points of fs on other disks cd /mnt/newgentoo/dev # need /dev/console and /dev/null for a successful boot # otherwise will get an error of "unable to open an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=212&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>quick note to myself, copy with caution..<br />
<code><br />
mkfs.ext4 /dev/sda2<br />
mount /dev/sda2 /mnt/newgentoo<br />
cp -xavv / /mnt/newgentoo/<br />
# -x is used b/c I have some dirs as mount points of fs on other disks<br />
cd /mnt/newgentoo/dev<br />
# need /dev/console and /dev/null for a successful boot<br />
# otherwise will get an error of "unable to open an initial console"<br />
# cf. http://www.gentoo.org/doc/en/udev-guide.xml, 3. Known issues<br />
mknod -m 660 console c 5 1<br />
mknod -m 660 null c 1 3<br />
</code></p>
<p>and finally, don&#8217;t forget to change /boot/grub/menu.lst and /mnt/newgentoo/etc/fstab</p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/gentoo/'>gentoo</a> Tagged: <a href='http://zeekish.wordpress.com/tag/devconsole/'>/dev/console</a>, <a href='http://zeekish.wordpress.com/tag/devnull/'>/dev/null</a>, <a href='http://zeekish.wordpress.com/tag/unable-to-open-an-initial-console/'>unable to open an initial console</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=212&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2010/12/05/migrating-gentoo-to-a-new-partition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
		<item>
		<title>gnuplot: different color on different segments of a curve</title>
		<link>http://zeekish.wordpress.com/2010/11/29/gnuplot-different-color-on-different-segments-of-a-curve/</link>
		<comments>http://zeekish.wordpress.com/2010/11/29/gnuplot-different-color-on-different-segments-of-a-curve/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 07:41:05 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[/usr/bin]]></category>
		<category><![CDATA[color segment]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=206</guid>
		<description><![CDATA[I&#8217;m not sure what&#8217;s the proper description, but here&#8217;s a task at hand and how it is done in gnuplot: suppose I have a datafile with 3 columns. I can plot columns 1 and 2 as a curve: gnuplot&#62; p 'datfile' u 1:2 In my problem, the 3rd column indicates whether the entry is &#8220;localized [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=206&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure what&#8217;s the proper description, but here&#8217;s a task at hand and how it is done in gnuplot:</p>
<p>
suppose I have a datafile with 3 columns. I can plot columns 1 and 2 as a curve:<br />
<code><br />
gnuplot&gt; p 'datfile' u 1:2<br />
</code></p>
<p>
In my problem, the 3rd column indicates whether the entry is &#8220;localized on the left side&#8221;, which will have <tt>abs($3)&gt;1</tt>, or the &#8220;right side&#8221;, having <tt>abs($3)&lt;1</tt>. I want the curve to be plotted in one color (say red) for the &#8220;left side&#8221; segment(s), and another color (say green) for the &#8220;right side&#8221; segment(s)</p>
<p>
somewhere in gnuplot&#8217;s manual, it says it will silently drop data if they are unplottable, and gives an example that <tt>1/0</tt> is unplottable (division by zero). so here&#8217;s the idea:</p>
<p>define the &#8220;above&#8221; and &#8220;below&#8221; function:<br />
<code><br />
  gnuplot&gt; above(x,a) = x &gt; a ? 1 : 1/0<br />
  gnuplot&gt; below(x,a) = x &lt; a ? 1 : 1/0<br />
</code><br />
then I can use them to pick out the left/right segments:<br />
<code><br />
  gnuplot&gt; p '' u 1:($2*above(abs($3),1)) w l lt rgb 'red' lw 2 tit "localized to the right"<br />
  gnuplot&gt; rep u 1:($2*below(abs($3),1)) w l lt rgb 'green' lw 2 tit "localized to the left"<br />
</code></p>
<p>
there is a minor problem: for data files, the segments with different colors are always separated by a small gap b/c neither <tt>above</tt> nor <tt>below</tt> would cover that gap. Haven&#8217;t thought about how to solve this yet, probably a clever redef of <tt>above</tt> and <tt>below</tt> could do the job.</p>
<p>Attached is some real world example.<br />
<a href="http://zeekish.files.wordpress.com/2010/11/edge_p3_q7.png"><img src="http://zeekish.files.wordpress.com/2010/11/edge_p3_q7.png?w=700&#038;h=492" alt="colored segments" title="colored segments" width="700" height="492" class="alignnone size-full wp-image-208" /></a></p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/usrbin/'>/usr/bin</a> Tagged: <a href='http://zeekish.wordpress.com/tag/color-segment/'>color segment</a>, <a href='http://zeekish.wordpress.com/tag/gnuplot/'>gnuplot</a>, <a href='http://zeekish.wordpress.com/tag/trick/'>trick</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=206&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2010/11/29/gnuplot-different-color-on-different-segments-of-a-curve/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>

		<media:content url="http://zeekish.files.wordpress.com/2010/11/edge_p3_q7.png" medium="image">
			<media:title type="html">colored segments</media:title>
		</media:content>
	</item>
		<item>
		<title>network printing on gentoo</title>
		<link>http://zeekish.wordpress.com/2010/11/21/network-printing-on-gentoo/</link>
		<comments>http://zeekish.wordpress.com/2010/11/21/network-printing-on-gentoo/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 07:43:31 +0000</pubDate>
		<dc:creator>zsh</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[cups]]></category>
		<category><![CDATA[lexmark c543 dn]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://zeekish.wordpress.com/?p=202</guid>
		<description><![CDATA[1. emerge cups. leave all conf files as-is 2. emerge foomatic-db-ppds, equivalently just download the ppd file corresponding to your printer (the one in my office is lexmark c543dn) 3. add yourself to the groups lp (for printing) and lpadmin (for using web interface to configure cups) 4. start cupsd (e.g., add it to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=202&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. emerge cups. leave all conf files as-is</p>
<p>2. emerge foomatic-db-ppds, equivalently just download the ppd file corresponding to your printer (the one in my office is lexmark c543dn)</p>
<p>3. add yourself to the groups lp (for printing) and lpadmin (for using web interface to configure cups)</p>
<p>4. start cupsd (e.g.,  add it to the default run-level), then visit https://localhost:631</p>
<p>5. add printer from within the web interface. For the lexmark mentioned above, locate the corresponding ppd file installed in step 2. The network address should be socket://ip-address-of-the-printer (I googled and saw on one lexmark official page that the printer should be accessed through the port 9100, which from the cups manual should have socket:// in its URI)</p>
<p>6. I also queried the printer&#8217;s default printing options from within cups web interface b/c the default option used by cups doesn&#8217;t utilize the duplex feature of the printer.</p>
<p>7. now just use lpr -P&amp;lt printer name &amp;gt to print (e.g., from the gtk printing dialogue box). &amp;lt printer name &amp;gt is the name you used in step 5 when adding the printer.</p>
<br />Filed under: <a href='http://zeekish.wordpress.com/category/gentoo/'>gentoo</a> Tagged: <a href='http://zeekish.wordpress.com/tag/cups/'>cups</a>, <a href='http://zeekish.wordpress.com/tag/lexmark-c543-dn/'>lexmark c543 dn</a>, <a href='http://zeekish.wordpress.com/tag/network/'>network</a>, <a href='http://zeekish.wordpress.com/tag/printing/'>printing</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeekish.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeekish.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/zeekish.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/zeekish.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeekish.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeekish.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeekish.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeekish.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeekish.wordpress.com&amp;blog=6962205&amp;post=202&amp;subd=zeekish&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zeekish.wordpress.com/2010/11/21/network-printing-on-gentoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/20c08e0c12eb3a320d8834f59bf34e32?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">zsh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
