<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6140527</id><updated>2024-03-07T17:03:51.319-08:00</updated><category term="R"/><category term="annoyance"/><category term="mac"/><category term="solr"/><category term="tech"/><title type='text'>sushil bajracharya&#39;s blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sushilbajra.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://sushilbajra.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sushil</name><uri>http://www.blogger.com/profile/07434558607970469639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6140527.post-1587405020079491614</id><published>2009-11-04T10:50:00.001-08:00</published><updated>2009-11-04T10:56:58.421-08:00</updated><title type='text'>getting tab separated values from postgres query</title><content type='html'>I keep forgetting this..&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;TUPLE MODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #\t&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;DISABLE FIELD ALIGNMENT #\a &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;TAB AS DELIMITER&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #\f &#39;\t&#39;&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;O/P TO FILE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #\o ~/out.txt&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;RUN QUERY&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #select …&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sushilbajra.blogspot.com/feeds/1587405020079491614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6140527/1587405020079491614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/1587405020079491614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/1587405020079491614'/><link rel='alternate' type='text/html' href='http://sushilbajra.blogspot.com/2009/11/getting-tab-separated-values-from.html' title='getting tab separated values from postgres query'/><author><name>sushil</name><uri>http://www.blogger.com/profile/07434558607970469639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6140527.post-8821278877933150887</id><published>2009-10-30T18:30:00.000-07:00</published><updated>2009-11-04T20:57:50.239-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="annoyance"/><category scheme="http://www.blogger.com/atom/ns#" term="mac"/><category scheme="http://www.blogger.com/atom/ns#" term="tech"/><title type='text'>Inverting colors in PDF</title><content type='html'>I am surprised that there does not seem to be an easy way to invert the colors in a PDF documents. Preview in mac allows to apply Quartz filters while doing a &#39;save as&#39;, but why inverting colors is not listed as one of the options? Adobe&#39;s reader allows you to substitute colors in Preferences but it does not work in a PDF that someone had tried to make prettier by putting strong colors as background. &lt;br /&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=451597&quot;&gt;solution&lt;/a&gt; that worked for me was using mogrify. It uses ImageMagik for doing the magic. Basically you can execute something like this in the Terminal:&lt;br /&gt;
&lt;blockquote&gt;$ mogrify -negate badly-colored.pdf&lt;br /&gt;
&lt;/blockquote&gt;But this did not fully solve the problem, I got a PDF whose background - out of the page&#39;s margin - was all black. The result looked as each page had thick black borders. Thanks to Preview this time, I was able to crop those margins out. First, make a rectangular selection, then select all PDFs in the thumbnail view, then apply crop. The end result was something workable.</content><link rel='replies' type='application/atom+xml' href='http://sushilbajra.blogspot.com/feeds/8821278877933150887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6140527/8821278877933150887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/8821278877933150887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/8821278877933150887'/><link rel='alternate' type='text/html' href='http://sushilbajra.blogspot.com/2009/10/inverting-colors-in-pdf.html' title='Inverting colors in PDF'/><author><name>sushil</name><uri>http://www.blogger.com/profile/07434558607970469639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6140527.post-2034136258716436531</id><published>2009-10-12T14:16:00.000-07:00</published><updated>2009-10-12T14:17:25.657-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="R"/><title type='text'>melting and casting tables</title><content type='html'>Hours after searching for how to do this in R, I finally found the right solution. The problem is, you have a table of counts like this&lt;br /&gt;
&lt;br /&gt;
Item, Red, Blue, Green&lt;br /&gt;
---------------------------- &lt;br /&gt;
Apple, 2, 3, 1&lt;br /&gt;
Ball, 0, 0, 3&lt;br /&gt;
&lt;br /&gt;
I wanted to convert it to a table as follows&lt;br /&gt;
&lt;br /&gt;
Item, Color, Count&lt;br /&gt;
------------------------ &lt;br /&gt;
Apple, Red, 2&lt;br /&gt;
Apple, Blue, 3&lt;br /&gt;
Apple, Green, 1&lt;br /&gt;
Ball, Red, 0&lt;br /&gt;
Ball, Blue, 0&lt;br /&gt;
Ball, Green, 3&lt;br /&gt;
&lt;br /&gt;
I had a hard time expressing this as a problem statement. What do I search for? I tried something like &quot;converting variables to single column&quot;, &quot;reversing contegency table&quot; blah blah.. At the end, not sure with what query, I ended up &lt;a href=&quot;http://www.statmethods.net/management/reshape.html&quot;&gt;here&lt;/a&gt;. How on earth should I know that a function called &#39;melt&#39; could do what I want. So much for being metaphorical.</content><link rel='replies' type='application/atom+xml' href='http://sushilbajra.blogspot.com/feeds/2034136258716436531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6140527/2034136258716436531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/2034136258716436531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/2034136258716436531'/><link rel='alternate' type='text/html' href='http://sushilbajra.blogspot.com/2009/10/melting-and-casting-tables.html' title='melting and casting tables'/><author><name>sushil</name><uri>http://www.blogger.com/profile/07434558607970469639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6140527.post-7596656066863117287</id><published>2009-09-02T15:52:00.000-07:00</published><updated>2009-09-03T15:16:17.337-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="solr"/><title type='text'>patch/build/test field collapsing with solr</title><content type='html'>&lt;a href=&quot;https://issues.apache.org/jira/browse/SOLR-236?focusedCommentId=12716364&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12716364&quot;&gt;This entry&lt;/a&gt; shows everything you need to path and build solr 1.3 with the field collapsing feature. To use the latest patch, do this:&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;wget --no-check-certificate https://issues.apache.org/jira/secure/attachment/12417524/field-collapse-5.patch&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;svn co http://svn.apache.org/repos/asf/lucene/solr/trunk/ ./apache-solr-trunk/&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;cd apache-solr-trunk/&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;patch -p0 &amp;lt;../field-collapse-5.patch &lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;ant example&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Update: It seems the above patch on the trunk has no effect of field collapsing but the patch as suggested in the link with 1.3 works. Also don&#39;t forget to register the collapse component for all handlers you with to use, eg: standard and dismax.&lt;/span&gt; &lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://sushilbajra.blogspot.com/feeds/7596656066863117287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6140527/7596656066863117287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/7596656066863117287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6140527/posts/default/7596656066863117287'/><link rel='alternate' type='text/html' href='http://sushilbajra.blogspot.com/2009/09/patchbuildtest-field-collapsing-with.html' title='patch/build/test field collapsing with solr'/><author><name>sushil</name><uri>http://www.blogger.com/profile/07434558607970469639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>