<?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>Desi Penguin’s Blog &#187; Hack</title>
	<atom:link href="http://desipenguin.com/techblog/category/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://desipenguin.com/techblog</link>
	<description>Open source, Tech Tips, Reviews, Tutorials and more …</description>
	<lastBuildDate>Tue, 29 Jun 2010 16:38:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Importing CSV file data into sqlite3</title>
		<link>http://desipenguin.com/techblog/2009/07/13/importing-csv-file-data-into-sqlite3/</link>
		<comments>http://desipenguin.com/techblog/2009/07/13/importing-csv-file-data-into-sqlite3/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 15:41:16 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Comma-separated values]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[sqlite3]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://desipenguin.com/techblog/?p=327</guid>
		<description><![CDATA[



Image via Wikipedia



I was trying to import the data from CSV file into sqlite3 database. Ideally this should be very simple task, with following the steps given in the sqlite tutorial. It is a matter of calling the sqlite command with separator argument, followed by an import operation, as listed below.

sqlite3 test.db  "create table [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignleft" style="width: 223px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:SQLite_Logo_4.png"><img title="The :en:SQLite logo as of 2007-12-15" src="http://upload.wikimedia.org/wikipedia/commons/thumb/1/19/SQLite_Logo_4.png/300px-SQLite_Logo_4.png" alt="The :en:SQLite logo as of 2007-12-15" width="213" height="63" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:SQLite_Logo_4.png">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>I was trying to import the data from <a class="zem_slink" title="Comma-separated values" rel="wikipedia" href="http://en.wikipedia.org/wiki/Comma-separated_values">CSV</a> file into <a class="zem_slink" title="SQLite" rel="homepage" href="http://www.sqlite.org/">sqlite3</a> database. Ideally this should be very simple task, with following the steps given in the sqlite tutorial. It is a matter of calling the sqlite command with separator argument, followed by an import operation, as listed below.</p>
<blockquote>
<pre>sqlite3 test.db  "create table t1 (t1key INTEGER PRIMARY KEY,data TEXT);"
sqlite3 -separator , test.db ".import some.csv t1"</pre>
</blockquote>
<p>Except that main attribute of my CSV file was that it could contain single records with embedded comma. I was hoping that sqlite3 would be smart enough to detect that the fields were enclosed within double quotes and then separate by comma. But I soon realized that only a code specifically dealing with CSV would know about this.  As we can see in the example above, the import is a generic code and as a user I listed comma as a separator.</p>
<p>My Data looked something like this :</p>
<blockquote>
<pre>"1","data1"
"2","data2,data3"</pre>
</blockquote>
<p>So like  any *nix geek would do, I tried  providing double quote <strong>and</strong> comma as a separator. To my surprise it worked very well. I though separator would take only single character, and I had provided two (three?). Anyway, important thing to remember is to escape the single quote with a <a class="zem_slink" title="Backslash" rel="wikipedia" href="http://en.wikipedia.org/wiki/Backslash">backslash</a> (I didn&#8217;t try it without the backslash, may be that would work too)</p>
<p>So here is the syntax that worked :</p>
<blockquote>
<pre>sqlite3 -separator \", test.db ".import mydata.csv mytbl"</pre>
</blockquote>
<p><em>Update : Turns out <a href="http://code.google.com/p/sqlite-manager/downloads/list" target="_blank">SQLite Manager</a> is much better solution after all.  It is an </em><em><a id="project_summary_link" style="text-decoration: none; color: #000000;" href="http://code.google.com/p/sqlite-manager/">Extension for Firefox and other apps to manage any sqlite database.</a></em><em> Not only it took care of above situation, it also handled empty cells as well where the command line failed with following error message : </em></p>
<blockquote>
<pre><em>line 4: expected 3 columns of data but found 2</em></pre>
</blockquote>
<p><em>Data with missing cells : Notice two successive commas :</em></p>
<blockquote>
<pre><em>"1","data1","data2"
"2","data3,data4","data5"
"3",,"data6"</em></pre>
</blockquote>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/037f00cf-f2be-47cc-89d4-863c249a4f99/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=037f00cf-f2be-47cc-89d4-863c249a4f99" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/07/13/importing-csv-file-data-into-sqlite3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Access your todo list from multiple locations</title>
		<link>http://desipenguin.com/techblog/2009/01/17/access-your-todo-list-from-multiple-locations/</link>
		<comments>http://desipenguin.com/techblog/2009/01/17/access-your-todo-list-from-multiple-locations/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 01:17:06 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cross platform]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[mSys]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/?p=135</guid>
		<description><![CDATA[Here is a clever method to access your todo list from multiple locations.
Ingredients

todo.sh &#8211; This is a command line shell scripts which allows to manage your TO DO list
DropBox Account : Free, Syncs various computers, Cross Platform (at least works on Windows as well as Linux)

Recipe

Make Sure you have installed Dropbox clients on all of [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a clever method to access your todo list from multiple locations.</p>
<h3>Ingredients</h3>
<ul>
<li><a href="http://todotxt.com/" target="_blank">todo.sh</a> &#8211; This is a command line shell scripts which allows to manage your TO DO list</li>
<li><a href="https://www.getdropbox.com/home" target="_blank">DropBox</a> Account : Free, Syncs various computers, Cross Platform (at least works on Windows as well as Linux)</li>
</ul>
<h3>Recipe</h3>
<ul>
<li>Make Sure you have installed Dropbox clients on all of your machines (Mainly Work and Home)</li>
<li>Download and install todo.sh in your Dropbox folder. This is main trick to make your TODO list portable.</li>
<li>You need to modify the .todo file (or todo.py script itself) to set the TODO_DIR variable. I&#8217;ve created a folder called &#8220;tododir&#8221; in my Dropbox folder, and set the TODO_DIR variable as &#8220;tododir&#8221;. This helps avoiding path problems on various machines.</li>
<li>(Optional) Read the tutorial available at <a href="http://lifehacker.com/software/top/geek-to-live--readerwritten-todotxt-manager-173018.php" target="_blank">LifeHacker</a></li>
<li>Open command Prompt, and take charge of your TODO lists.</li>
</ul>
<h3>Why This Idea Rocks</h3>
<ul>
<li>Since the todo list is maintained as simple text file, any machine/platform allows you to directly view and edit your todo list.</li>
<li>While one would install Dropbox clients on all of their regularly used machines, You can always view and edit your todo.txt even from a cyber cafe, using Dropbox&#8217;s web interface.</li>
</ul>
<h3>Are you on Windows ?</h3>
<ul>
<li>If you are on Windows, you will require <a href="http://www.cygwin.com/" target="_blank">cygwin </a>which provides unix utilities on windows. (I was unable to get todo.sh working with mSys, which I got as part of <a href="http://code.google.com/p/msysgit/downloads/list" target="_blank">mSys Git</a> (More about it later, in another post))</li>
<li>There is a variation of todo.sh written in Python (which is what I&#8217;m using these days). If which case, you need <a href="http://www.python.org/download/" target="_blank">Python </a>instead of Cygwin. Python version supports color coding of the items based on priority even on Windows.</li>
</ul>
<h3>Can I not just use USB Drive instead ?</h3>
<ul>
<li>Sure you can.  But some employers do not allow the employees to connect their personal USB devices to office computers. (Security, Virus threats) in which case Dropbox is better alternative.</li>
<li>Even Cyber cafe won&#8217;t allow to plug in your USB drive, but you sure can access your files from Web Front end of Dropbox.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/01/17/access-your-todo-list-from-multiple-locations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Productive use of Active Desktop &#8211; More ideas</title>
		<link>http://desipenguin.com/techblog/2009/01/07/productive-use-of-active-desktop-more-ideas/</link>
		<comments>http://desipenguin.com/techblog/2009/01/07/productive-use-of-active-desktop-more-ideas/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 16:08:02 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[active desktop]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/?p=123</guid>
		<description><![CDATA[Once you understand the idea behind using the Active Desktop, you can come up with several creative and unique ideas to make this feature work for you.  Let me get you started by listing some that came to my mind.

Apart from the mini phone list, I also have my Plan of the Week, as another [...]]]></description>
			<content:encoded><![CDATA[<p>Once you understand the idea behind using the Active Desktop, you can come up with several creative and unique ideas to make this feature work for you.  Let me get you started by listing some that came to my mind.</p>
<ol>
<li>Apart from the mini phone list, I also have my <em>Plan of the Week</em>, as another HTML on my Desktop. At the end of each week, I create the plan of next week (Friday 4-6PM). Again, it is very easy to convert any piece of text into an HTML.</li>
<li>Use a web page as Sticky Note to yourself. No Coding needed. Check <a href="http://www.stickyscreen.org/" target="_blank">this </a>out.</li>
<li>You can put your <a href="http://lifehacker.com/software/google-calendar/how-to-make-your-google-calendar-your-pcs-desktop-wallpaper-251638.php" target="_blank">Google Calendar on your Desktop</a>.</li>
</ol>
<p><b>Please share your ideas in the comments</b></p>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/01/07/productive-use-of-active-desktop-more-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Productive Use of Active Desktop</title>
		<link>http://desipenguin.com/techblog/2009/01/05/productive-use-of-active-desktop/</link>
		<comments>http://desipenguin.com/techblog/2009/01/05/productive-use-of-active-desktop/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 02:27:04 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[active desktop]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/?p=88</guid>
		<description><![CDATA[Refer to my previous post about displaying my To Do list on the Desktop. I have since stopped using todo.sh for various reasons. But I continue to use the Active Desktop feature of Windows XP.  One of the use I have found, is to display a mini phone list.

I recently joined a smaller organization. Although [...]]]></description>
			<content:encoded><![CDATA[<p>Refer to my <a href="http://desipenguin.wordpress.com/2007/05/28/my-clean-desktop/" target="_blank">previous post</a> about displaying my To Do list on the Desktop. I have since stopped using todo.sh for various reasons. But I continue to use the Active Desktop feature of Windows XP.  One of the use I have found, is to display a mini phone list.</p>
<p><span id="more-88"></span></p>
<p>I recently joined a smaller organization. Although there are over 50+ employees, I need to interact with about 5-6 people of regular basis, and another 4-5 on not so regular basis.  So although they have an Excel document containing a big list, I don&#8217;t want to refer to that document every time I need to make a call, so I created a short .html file containing the compressed extension list. Here is how you can do it too.</p>
<h3>Create a phone list</h3>
<ol>
<li>Create a simple spreadsheet containing the name and extension. You can get creative and add their cell numbers as well, if you want.</li>
<li>Save this as HTML file. This option is available in OpenOffice.org (3.x) and I think even in MS Office as well</li>
<li>OR You can create your phone list as csv file, and use <a href="http://www.winscripter.com/WSH/FileIO/76.aspx" target="_blank">this </a>script to convert it to HTML</li>
<li>If you like to have more control of how your HTML looks,  you can hand-code HTML code using simple HTML table. I used gvim to edit the file, but you can use your favorite editor.</li>
</ol>
<h3>Use it on your Desktop</h3>
<ol>
<li>Right Click on your Windows Desktop, Click on Properties Menu option.  You will be presented with <em>Display Properties</em> page</li>
<li>Click on the tab named <em>Desktop</em></li>
<li>Click on <em>Customize Desktop</em> button located at the bottom of the tab.</li>
<li>Click on the tab named <em>Web</em></li>
<li>Click on <em>New</em>, and point (using <em>Browse </em>button provided by the wizard, if needed) to the newly created HTML Page.</li>
<li>Make sure that your newly added page shows up in the list, and that the checkbox  is selected.</li>
<li>Click OK, to close the <em>Desktop Items</em> dialog. Also close the <em>Display Properties</em> dialog by clicking OK</li>
<li>Now you should see your Phone list on your Windows Desktop.</li>
</ol>
<p>Now, whenever you need to refer to the phone list, all you need to do is press Windows+D to have a look at your desktop.</p>
<p><em><span style="color:#808080;">Note : I&#8217;ve tested this only on Windows XP, instructions might differ for Vista.</span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2009/01/05/productive-use-of-active-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calendaring with Thunderbird 3 Beta</title>
		<link>http://desipenguin.com/techblog/2008/12/19/calendaring-thunderbird-3-beta/</link>
		<comments>http://desipenguin.com/techblog/2008/12/19/calendaring-thunderbird-3-beta/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 01:53:57 +0000</pubDate>
		<dc:creator>Mandar Vaze</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://desipenguin.wordpress.com/?p=84</guid>
		<description><![CDATA[In my last post about Thunderbird 3 Beta, I mentioned that extensions do that work with the Tunderbird 3 Beta. One of the important Add-on I have been using with Tunderbird 2 was Lightning. This Add-on provides Calendering functionality to Thunderbird, making it (near) complete substitute for MS Outlook. Near complete because there is no [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post about Thunderbird 3 Beta, I mentioned that extensions do that work with the Tunderbird 3 Beta. One of the important Add-on I have been using with Tunderbird 2 was <a href="https://addons.mozilla.org/en-US/thunderbird/addon/2313" target="_blank">Lightning</a>. This Add-on provides Calendering functionality to Thunderbird, making it (near) complete substitute for MS Outlook. Near complete because there is no MS Exchange integration yet.</p>
<p>Then I found out a way to get this working with the Tunderbird 3 Beta</p>
<p><span id="more-84"></span></p>
<h3>Install the Extenstion</h3>
<ol>
<li>Get the extension from <a href="https://addons.mozilla.org/en-US/thunderbird/addon/4623" target="_blank">here</a>.</li>
<li>Download the .xpi file on your computer.</li>
<li>Go to Tools-&gt;Add-ons. Click on Install button. Point to the newly downloaded .xpi file.</li>
<li>Restart Thunderbird 3 Beta for the Add-on to be active.</li>
<li>Now you should see <em>Lightning Nightly Updater</em> in Add-ons list.</li>
</ol>
<h3>Configure</h3>
<ol>
<li>Click on Options button for this extension</li>
<li>If you actively use Google Calendar, then select second mode <em>Also install Provided for Google Calendar</em></li>
<li>Leave both options under <em>Backup </em>as checked</li>
<li>It is good idea to click <em>Backup Now</em> button. If you are installing Lightning for the first time, skip this step.</li>
</ol>
<p>This in itself doesn&#8217;t install the Lightning extension. As the name suggests, this is the extension to help you keep up to date with another extension <img src='http://desipenguin.com/techblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li>Go to Help-&gt;Check for Latest Lightning update. You will now download the real Lightning extension (Two, if you have selected to download <em>Provider for Google Calendar</em>) </li>
<li>Download and install as usual. Restart Thunderbird for the extension to be effective.</li>
<li>Now you will see two icons towards the far right of the &#8220;Tab bar&#8221;. Tooltips reveal these to be Calendar and Tasks respectively. (This puzzled me for a while, as to how do I access these functions now that I have installed the extensions)</li>
<li>When you click on these icons, two new tabs will open. It is very intuitive after that.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://desipenguin.com/techblog/2008/12/19/calendaring-thunderbird-3-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
