<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Geeky Gospel</title>
	<atom:link href="http://geekygospel.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://geekygospel.wordpress.com</link>
	<description>Some Geeky words of wisdom.</description>
	<lastBuildDate>Tue, 08 Sep 2009 14:11:16 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='geekygospel.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/33df1bc7d53bbc2ab08d0b7f09577e62?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Geeky Gospel</title>
		<link>http://geekygospel.wordpress.com</link>
	</image>
			<item>
		<title>Working with Minix 3 on Ubuntu with VirtualBox</title>
		<link>http://geekygospel.wordpress.com/2009/09/08/working-with-minix-3-on-ubuntu-with-virtualbox/</link>
		<comments>http://geekygospel.wordpress.com/2009/09/08/working-with-minix-3-on-ubuntu-with-virtualbox/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 14:11:16 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cd transfers]]></category>
		<category><![CDATA[course work]]></category>
		<category><![CDATA[isodir]]></category>
		<category><![CDATA[isoread]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[jaunty jackalope]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[minix]]></category>
		<category><![CDATA[minix 3]]></category>
		<category><![CDATA[minix 3.1.3a]]></category>
		<category><![CDATA[minix svn repo]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[recompiling kernels for minix]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Ubuntu 9.04]]></category>
		<category><![CDATA[virtual machines]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[VirtualBox 3.0.4]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=73</guid>
		<description><![CDATA[In my OS course, we use the Minix operating system. We have various assignments that require us to edit kernel source code, etc. We use virtual machines for doing our work, and my preferred VM software is VirtualBox. There seems to be little info about using Minix with VirtualBox on the net, as Minix is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=73&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In my OS course, we use the <a href="http://www.minix3.org/" target="_blank">Minix</a> operating system. We have various assignments that require us to edit kernel source code, etc. We use virtual machines for doing our work, and my preferred VM software is VirtualBox. There seems to be little info about using Minix with VirtualBox on the net, as Minix is not officially supported by VBox. Nevertheless it can be used fine. I am going to write about my own setup in roughly tutorial form.</p>
<p>First, about my software versions. At the time of this writing, I am using:</p>
<ol>
<li> the latest stable Ubuntu, which is Jaunty Jackalope, version 9.04, as the host operating system,</li>
<li>the latest stable VirtualBox, which is version 3.0.4, and,</li>
<li>the latest stable Minix 3, version 3.1.3a</li>
</ol>
<p>It is quite simple to <a href="http://www.google.co.in/search?q=install+virtualbox+on+ubuntu" target="_blank">install Virtualbox on Ubuntu</a>.</p>
<h2>Installing Minix on VBox</h2>
<p><a href="http://wiki.minix3.org/en/UsersGuide/RunningMinixOnVirtualBox" target="_blank">http://wiki.minix3.org/en/UsersGuide/RunningMinixOnVirtualBox</a></p>
<p>My own VM settings are 128 MB RAM and a 1 GB virtual hard disk.</p>
<h2>Installing packages</h2>
<p><a href="http://wiki.minix3.org/en/UsersGuide/InstallingBinaryPackages" target="_blank">http://wiki.minix3.org/en/UsersGuide/InstallingBinaryPackages</a></p>
<p>Packages that are useful for me: flex, gcc, emacs, less, make.</p>
<h2>Networking</h2>
<p>Networking has not been possible to setup. I have tried to get bridged networking to work, so that files can be shared via ssh, but it has not worked yet. I will update if I do succeed. Please post in the comments if you have any tips.</p>
<p>Networking would have been ideal for transferring files both ways between the two OSes, but I am managing with one way transfers for now (Linux to Minix).</p>
<h2>Exchanging files between Minix and Ubuntu</h2>
<p>I have so far only succeeded in copying files into the guest OS and not vice versa. Since networking has not worked for me, I transfer files via cd images. To transfer single files, create a cd image containing the files in Ubuntu with:</p>
<pre>mkisofs -o t.iso &lt;list of single files&gt;</pre>
<p>Then, mount the cd image in the VM through VBox&#8217;s GUI: Devices-&gt;Mount CD ROM. To read the cdrom in Minix, use the <a href="http://www.minix3.org/manpages/man1/isoread.1.html" target="_blank">isoread</a>, and <a href="http://www.minix3.org/manpages/man1/isodir.1.html" target="_blank">isodir</a> commands. To copy files from the cd, use a command of the form:</p>
<pre>isoread - /dev/c0d2 src.c &gt; src.c</pre>
<p>Don&#8217;t forget the hyphen after &#8220;isoread&#8221;.</p>
<p>Copying a whole directory into minix may seem complex using the above method, but the trick is to create a tar file out of the directory we want to copy. We copy the tar archive into minix using the method discussed above and then extract it in the guest.</p>
<h2>Getting Minix kernel sources</h2>
<p>This initially turned out to be challenging, because though the source code is available in the VM at /usr/src, it can&#8217;t be copied to the host for editing using powerful editors in Linux. The source code is available on the Minix cd but it is present in a cd sub-partition that is in the Minix filesystem format. Also, there is no readily available download package on the Minix website.</p>
<p>But there is the <a href="https://gforge.cs.vu.nl/gf/project/minix/scmsvn/" target="_blank">SVN repo</a>. The only thing to find is the right revision for the version of Minix we use. Looking the <a href="https://gforge.cs.vu.nl/gf/project/minix/scmsvn/?action=browse&amp;path=%2Ftags%2F" target="_blank">tags</a> folder, helped. To download the sources for my version, I fired off a terminal and typed:</p>
<p><tt>svn checkout https://gforge.cs.vu.nl/svn/minix/tags/r3_1_</tt>3a</p>
<p>Enter the username as &#8220;anonymous&#8221; and enter a blank password.</p>
<p>To get rid of the .svn folders (these are not part of Minix source code) inside the sources folder we downloaded, use the following command from inside the folder created by the subversion checkout:</p>
<pre>find . -name ".svn$" | xargs rm -rf</pre>
<p>Now our sources are ready for editing.</p>
<h2>Recompiling the Minix kernel</h2>
<p>After we edit sources, we copy the files into Minix&#8217;s /usr/src. Then, from /usr/src/ we type:</p>
<pre>make world</pre>
<p>If everything works, this builds a new kernel and sets it up for booting. Type &#8220;shutdown&#8221; to shutdown the VM, and from the boot prompt, type &#8220;boot d0p0&#8243; to start minix. In the resulting boot menu enter &#8220;3&#8243;, and we boot into the kernel we just modified! More information about recompiling is <a href="http://wiki.minix3.org/en/DevelopersGuide/TrackingCurrent" target="_blank">here</a>.</p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:534px;width:1px;height:1px;">
<h2>/r3_1_3a</h2>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=73&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2009/09/08/working-with-minix-3-on-ubuntu-with-virtualbox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Editing files on remote servers via multihop-ssh on emacs</title>
		<link>http://geekygospel.wordpress.com/2009/07/25/editing-files-on-remote-servers-via-multihop-ssh-on-emacs/</link>
		<comments>http://geekygospel.wordpress.com/2009/07/25/editing-files-on-remote-servers-via-multihop-ssh-on-emacs/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 16:49:58 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[tramp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[openssh]]></category>
		<category><![CDATA[multihop]]></category>
		<category><![CDATA[remote access]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=62</guid>
		<description><![CDATA[Suppose you need to access you department&#8217;s computer from outside the institute. The usual solution would be to use ssh. But what if you can access your department&#8217;s computer only via a different computer in your institute? Multiple ssh would be the usual way:

aditya@donatello:~$ ssh clac.edu
aditya@clac.edu's password:
aditya@clac.edu:~$ ssh adi@malhar
adi@malhar's password:
adi@malhar:~$

This is the situation at my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=62&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Suppose you need to access you department&#8217;s computer from outside the institute. The usual solution would be to use ssh. But what if you can access your department&#8217;s computer only via a different computer in your institute? Multiple ssh would be the usual way:</p>
<blockquote>
<pre>aditya@donatello:~$ ssh clac.edu
aditya@clac.edu's password:
aditya@clac.edu:~$ ssh adi@malhar
adi@malhar's password:
adi@malhar:~$</pre>
</blockquote>
<p>This is the situation at my institute where, we have access to one central departmental server via ssh, from which we can access computers in our labs.</p>
<p>I found that a single command is sufficient to achieve this:</p>
<blockquote>
<pre>ssh -t clac.edu -t ssh adi@malhar</pre>
</blockquote>
<p>Ssh prompts for the password twice, first for <em>clac.edu</em> and then for <em>adi@malhar</em>.</p>
<p>This is however not usually sufficient. We want to edit files remotely too. Being an emacs fan, I heard how tramp is a great component of emacs that lets you access files on remote hosts via ssh. I use it pretty often. But the <a href="http://www.gnu.org/software/tramp/#Multi_002dhops" target="_blank">usual</a> <a href="http://stackoverflow.com/questions/715855/how-can-i-use-emacs-tramp-to-double-hop-ssh" target="_blank">way</a> of using tramp to access files through multihop ssh did not work for me. Tramp would just wait for 60 secs and then say that login failed. Perhaps they might work for you.</p>
<p>After a little more investigation, I found that OpenSSH can do wonderful things. Let&#8217;s say we want to access a file on the host <em>malhar</em> in the example above. OpenSSH can be configured to access <em>malhar</em> by proxying through <em>clac.edu</em>. The settings are reasonably simple. Just open <em>~/.ssh/config</em> and enter the lines:</p>
<blockquote>
<pre>Host malhar
ProxyCommand ssh clac.edu nc malhar 22</pre>
</blockquote>
<p>This requires that the server at <em>clac.edu</em> have a program called <em>netcat</em> installed. Luckily in my case, the server did.</p>
<p>Once this was setup, tramp is able to access files on <em>malhar</em>. I press <strong>C-x f</strong> (the emacs key combo to open a file) and enter <em>/ssh:adi@malhar:textfile.txt </em>and then<em> </em>tramp prompts for a password twice. First enter the password for <em>clac.edu</em> and then for <em>adi@malhar</em>, and we&#8217;re in. Awesome!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/62/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/62/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/62/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=62&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2009/07/25/editing-files-on-remote-servers-via-multihop-ssh-on-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Dump MySQL table into CSV</title>
		<link>http://geekygospel.wordpress.com/2009/07/21/dump-mysql-table-into-csv/</link>
		<comments>http://geekygospel.wordpress.com/2009/07/21/dump-mysql-table-into-csv/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 05:31:56 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Free and Open Source]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OpenSource Software]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[WEKA]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=58</guid>
		<description><![CDATA[I needed to dump MySQL tables into CSV for use with WEKA. A little google search helped. I found this. I am copying the command here for my reference:
SELECT * INTO OUTFILE &#8216;result.csv&#8217;
FIELDS TERMINATED BY &#8216;,&#8217; OPTIONALLY ENCLOSED BY &#8216;&#8221;&#8216;
LINES TERMINATED BY &#8216;\n&#8217;
FROM my_table;
Thank you, Terminally Incoherent! I love MySQL too!
     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=58&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I needed to dump MySQL tables into CSV for use with <a href="http://www.cs.waikato.ac.nz/~ml/weka/">WEKA</a>. A little google search helped. I found <a href="http://www.terminally-incoherent.com/blog/2006/07/20/dump-mysql-table-into-csv-file/">this</a>. I am copying the command here for my reference:</p>
<blockquote><p>SELECT * INTO OUTFILE &#8216;result.csv&#8217;<br />
FIELDS TERMINATED BY &#8216;,&#8217; OPTIONALLY ENCLOSED BY &#8216;&#8221;&#8216;<br />
LINES TERMINATED BY &#8216;\n&#8217;<br />
FROM my_table;</p></blockquote>
<p>Thank you, <a href="http://www.terminally-incoherent.com">Terminally Incoherent</a>! I love MySQL too!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=58&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2009/07/21/dump-mysql-table-into-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting WiFi to work on Intel PRO/Wireless 3945ABG in Ubuntu Hardy</title>
		<link>http://geekygospel.wordpress.com/2008/10/30/getting-wifi-to-work-on-intel-prowireless-3945abg-in-ubuntu-hardy/</link>
		<comments>http://geekygospel.wordpress.com/2008/10/30/getting-wifi-to-work-on-intel-prowireless-3945abg-in-ubuntu-hardy/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 09:53:07 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Acer]]></category>
		<category><![CDATA[Acer TravelMate 5720]]></category>
		<category><![CDATA[ELCOT]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[Intel PRO/Wireless 3945ABG]]></category>
		<category><![CDATA[iwl3945]]></category>
		<category><![CDATA[ubuntu hardy]]></category>
		<category><![CDATA[wicd]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[Wifi LED]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=47</guid>
		<description><![CDATA[I have a brand new Elcot Laptop (Acer TravelMate 5720), which came with Suse Enterprise and Ubuntu Hardy preinstalled. I prefer Ubuntu, but I found that it does not detect my wireless card. My wireless device is Intel PRO/Wireless 3945ABG.
If you have the same setup you can simply follow the steps that I did. To [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=47&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have a brand new Elcot Laptop (Acer TravelMate 5720), which came with Suse Enterprise and Ubuntu Hardy preinstalled. I prefer Ubuntu, but I found that it does not detect my wireless card. My wireless device is <a href="http://www.google.co.in/search?hl=en&amp;q=Intel+PRO%2FWireless+3945ABG&amp;btnG=Google+Search&amp;meta=" target="_blank">Intel PRO/Wireless 3945ABG</a>.</p>
<p>If you have the same setup you can simply follow the steps that I did. To check what wireless device you have, run:</p>
<blockquote><p>sudo lshw -C network</p></blockquote>
<p>To get your card running, create a file in /etc/modprobe.d called <strong>iwl3945</strong>. Paste the following into it:</p>
<blockquote><p>alias wlan0 iwl3945<br />
options iwl3945 disable_hw_scan=1 hwcrypto=1</p></blockquote>
<p>Now, you need to install the package <em>linux-backports-modules-hardy-generic.</em> To do this, you need to enable the Hardy Backports repository in Synaptic and then install it. If you are not sure how to do this, you can find instructions with screenshots <a href="http://linuxtechie.wordpress.com/2008/04/24/making-intel-wireless-3945abg-work-better-on-ubuntu-hardy/" target="_blank">here</a>.</p>
<p>Reboot and your device should be working along with the wifi LED. You should be able to connect to unencrypted networks using this setup. A different network manager is needed connect to encrypted networks called wicd. To install wicd, follows <a href="http://wicd.sourceforge.net/download.php" target="_blank">these</a> instructions. You should be all set now!</p>
<p>NOTE: All this information is also available in many scattered discussions in the <a href="http://ubuntuforums.org" target="_blank">Ubuntu Forums</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=47&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/10/30/getting-wifi-to-work-on-intel-prowireless-3945abg-in-ubuntu-hardy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Best buys this season: The ELCOT Student Laptop</title>
		<link>http://geekygospel.wordpress.com/2008/07/08/best-buys-this-season-the-elcot-student-laptop/</link>
		<comments>http://geekygospel.wordpress.com/2008/07/08/best-buys-this-season-the-elcot-student-laptop/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 12:55:39 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Product]]></category>
		<category><![CDATA[Acer]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[ELCOT]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[Students]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=39</guid>
		<description><![CDATA[The Electronics Corporation of Tamil Nadu has started this year&#8217;s sale of inexpensive laptops with preloaded Linux (SUSE Linux Enterprise) for students studying in Tamil Nadu. There have been many press releases, for example, see this one. The laptop is said to be procured from Dell or Acer.
The high capacity version of the ELCOT laptop [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=39&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The <a href="http://elcot.in/" target="_blank">Electronics Corporation of Tamil Nadu</a> has started this year&#8217;s <a href="http://www.elcot.in/StudentLaptop2008/index.php" target="_blank">sale</a> of inexpensive laptops with preloaded Linux (SUSE Linux Enterprise) for students studying in Tamil Nadu. There have been many press releases, for example, see <a href="http://www.thehindu.com/2008/07/07/stories/2008070754130400.htm" target="_blank">this</a> one. The laptop is said to be procured from Dell or Acer.</p>
<p>The high capacity version of the ELCOT laptop is priced at <a href="http://www.google.co.in/search?q=31717+INR+in+USD">Rs. 31,717</a> and is really cheap! To be really convinced of this, I checked out the Dell site for their price on an equivalent configuration. This is really easy, because they have a nice customise feature on their site. So I went <a href="http://www1.ap.dell.com/content/products/features.aspx/featured_notebook7?c=in&amp;cs=indhs1&amp;l=en&amp;s=dhs" target="_blank">here</a> and chose options to make the configuration equivalent to ELCOT&#8217;s config <a href="http://www.elcot.in/StudentLaptop2008/schemeSpecification.php" target="_blank">here</a>. The <a href="http://verboselyme.files.wordpress.com/2008/07/dell-offer.pdf" target="_blank">results</a> are astounding! The Dell price turns out to be <a href="http://www.google.co.in/search?q=55317+INR+in+USD" target="_blank">Rs. 55317</a>! The big price addons were 7000 rupees for the 320 GB upgrade, from 160 GB and the 3 years international support which added another (approx.) 8000 rupees. Of course, since Dell has not rolled out its preloaded Linux version in India (Dell sells with Ubuntu preloaded, in the US), the price above includes the price of Microsoft&#8217;s operating system.</p>
<p><strong>Students are going to make a killing in this sale! Hurry! Last date for registrations in this first phase is July 15.</strong></p>
<p><strong>Edit: Elcot has extended the last date, as expected. The new last date is 31 July.</strong></p>
<p><strong>Edit 2: Elcot has further extended the last date! The new last date is 15 August.</strong></p>
<p><strong>Edit 3: Elcot has further extended the last date! The new last date is 31 August. And, I&#8217;m bored of updating this.</strong></p>
<p><strong>Edit 4: Elcot has finally closed the student laptop scheme 2008.<br />
</strong></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/geekygospel.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/geekygospel.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=39&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/07/08/best-buys-this-season-the-elcot-student-laptop/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Breaking the Monotony</title>
		<link>http://geekygospel.wordpress.com/2008/07/05/breaking-the-monotony/</link>
		<comments>http://geekygospel.wordpress.com/2008/07/05/breaking-the-monotony/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 14:43:46 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[humour]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=36</guid>
		<description><![CDATA[Rickrolling is such a funny term.
Ok, I made it to IISc: http://csa.iisc.ernet.in/people. Not too discombobulated I hope? Ok then.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=36&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.rickastley.co.uk/" target="_blank">Rickrolling</a> is such a <a href="http://xkcd.com/351/" target="_blank">funny</a> <a href="http://en.wikipedia.org/wiki/Internet_memes" target="_blank">term</a>.</p>
<p>Ok, I <a href="http://verboselyme.wordpress.com/2008/06/26/well-i-really-thought-the-clouds-had-cleared-up/" target="_blank">made it</a> to <a href="http://www.iisc.ernet.in/" target="_blank">IISc</a>: <a href="http://youtube.com/watch?v=Yu_moia-oVI" target="_blank">http://csa.iisc.ernet.in/people</a>. Not too <a href="http://www.google.co.in/search?q=define%3A+discombobulated&amp;ie=utf-8" target="_blank">discombobulated</a> I hope? Ok <a href="http://en.wikipedia.org/wiki/Rickroll" target="_blank">then</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/geekygospel.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/geekygospel.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=36&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/07/05/breaking-the-monotony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Download day Announced!</title>
		<link>http://geekygospel.wordpress.com/2008/06/14/download-day-announced/</link>
		<comments>http://geekygospel.wordpress.com/2008/06/14/download-day-announced/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 07:27:53 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Free and Open Source]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[download day]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[spread firefox]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=32</guid>
		<description><![CDATA[

17th June 2008

That&#8217;s the official release date that has been announced for Firefox 3 on the Mozilla Developers blog! So lets get ready to implement our pledges and download the best browser out there!
EDIT: 15th June&#8217;s &#8220;The Hindu&#8221; newspapers features an article about Ubuntu and Firefox, how they rock and why they are great for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=32&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.spreadfirefox.com/en-US/worldrecord"><img src="http://www.spreadfirefox.com/sites/all/themes/spreadfirefox_RCS/images/download-day/buttons/en-US/468x60_dday.png" border="0" alt="Download Day 2008" /></a></p>
<blockquote>
<h3>17th June 2008</h3>
</blockquote>
<p>That&#8217;s the official release date that has been <a href="http://developer.mozilla.org/devnews/index.php/2008/06/11/coming-tuesday-june-17th-firefox-3/" target="_blank">announced</a> for Firefox 3 on the Mozilla Developers blog! So lets get ready to implement our pledges and download the best browser out there!</p>
<p>EDIT: 15th June&#8217;s &#8220;The Hindu&#8221; newspapers <a href="http://www.hinduonnet.com/thehindu/thscrip/print.pl?file=2008061550811100.htm&amp;date=2008/06/15/&amp;prd=th&amp;" target="_blank">features</a> an article about Ubuntu and Firefox, how they rock and why they are great for Linux newbies!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/geekygospel.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/geekygospel.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=32&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/06/14/download-day-announced/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>

		<media:content url="http://www.spreadfirefox.com/sites/all/themes/spreadfirefox_RCS/images/download-day/buttons/en-US/468x60_dday.png" medium="image">
			<media:title type="html">Download Day 2008</media:title>
		</media:content>
	</item>
		<item>
		<title>Interesting CS Interview Questions #2</title>
		<link>http://geekygospel.wordpress.com/2008/06/12/interesting-cs-interview-questions-2/</link>
		<comments>http://geekygospel.wordpress.com/2008/06/12/interesting-cs-interview-questions-2/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 20:58:15 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[binary tree]]></category>
		<category><![CDATA[C program]]></category>
		<category><![CDATA[Complexity]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[linked lists]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[Probability]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[SDT]]></category>
		<category><![CDATA[software development engineer]]></category>
		<category><![CDATA[Space complexity]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[Time complexity]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=31</guid>
		<description><![CDATA[This post is a continuation of my interesting CS interview questions series. The last two problems discussed in this post lean more towards logic and probability rather than a CS concept.
Consider the Lock and Unlock operation defined on an m-ary tree as follows:
Lock Node X =&#62; If (no node present in the subtree rooted at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=31&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This post is a continuation of my <a href="http://geekygospel.wordpress.com/2008/06/10/interesting-cs-interview-questions-1/" target="_blank">interesting CS interview questions</a> series. The last two problems discussed in this post lean more towards logic and probability rather than a CS concept.</p>
<p><span style="text-decoration:underline;"><strong>Consider the Lock and Unlock operation defined on an m-ary tree as follows:</strong></span></p>
<p><span style="text-decoration:underline;"><strong>Lock Node X =&gt; If (no node present in the subtree rooted at X (including X) is locked) AND (no direct ancestor of X is locked), then lock X</strong></span></p>
<p><span style="text-decoration:underline;"><strong>Unlock Node X =&gt; Assumes that it is called only a node that has been previously locked. Simply unlocks the node X.</strong></span></p>
<p><span style="text-decoration:underline;"><strong>Design an efficient data structure and algorithms to perform the required lock and unlock operations.</strong></span></p>
<p>The first solutions that struck me was to simply perform a complete tree traversal and determine if the required conditions for locking are being met or not. This has complexity O(N) where N is the number of nodes. Is this the best that can be done?</p>
<p>On further thought, since we can decide the data structure which suits us best, we can improve the efficiency. Suppose for each node we have a pointer to the parent node. Then, determining if any direct ancestor is locked is simply a loop that climbs the tree, via the parent pointers. How to check if any of the children in the subtree is already locked? Another traversal is possible, but it would not improve our time complexity. If a node is locked, all the direct ancestors need to know that a child is locked. So, this gives the idea to use a flag for each node which is set if a child is locked. Now the lock operation can check if a child is locked in constant time. After locking successfully, it needs to traverse back up to the root via the parent pointers and mark for each node that a child is locked.</p>
<p>How will unlock happen then? We just unlock the node that is given, but we cannot simply unmark the child-node-locked flags in the parents. Why? Because there may be other children that are locked! This seems to complicate things. But not really. Instead of using a flag to hold the information, we use an integer. The integer simply counts the number of child nodes locked. Thus, while unlocking we simply decrement these counts.</p>
<p>Now, what is the time complexity? It is logarithmic because we only look at the path from the node to the root (via the parent pointers).</p>
<p><strong><span style="text-decoration:underline;">This one is like a puzzle. A table has 100 coins, 30 of them with Heads facing up. There is another table with no coins. With your eyes blindfolded, what will do so that the number of coins with Heads facing up is equal on each table? You cannot determine if a coin is facing Heads up or not by touching it. You are basically allowed to flip coins and move them from one table to the other.<br />
</span></strong></p>
<p>This problem was pretty challenging for me. Initially the number of Heads in each table is 30 and 0. After experimenting various things with a smaller number of coins, one notices (or at least is supposed to notice) that moving one coin from the first table to the second and flipping it causes the difference in the number of Heads between the tables to decrease by 1. Why? Suppose the coin was a Head in the first table. On flipping and moving it to the other table, the number of Heads in the first table decreases by 1 but the number of Heads on the second table remains the same (as it is added to the Tails count). If the coin was a Tail, then it increases the Heads count in the second table without affecting that of the first table. So the solution is to repeat this process of choosing some coin and flipping it, and moving it to the other table, 30 times. Since the initial difference in the number of Heads is 30, after this process the difference becomes 0. Thus, the number of Heads is equal in each table.</p>
<p><span style="text-decoration:underline;"><strong>Given a long stream of numbers, how will you choose a single number, such that it is uniformly random among the numbers so far seen?</strong></span></p>
<p>Although, one can store all the numbers and then choose one at random using standard random functions (like in C), we would like a method that is space efficient. There does exist a method that requires only constant space. Any idea?</p>
<p>Say we have reached the <strong>N</strong>-th number in the sequence and suppose we already have the solution for the first <strong>(N-1)</strong> numbers that appeared in the sequence. Suppose this solution is <strong>X</strong>. Then <strong>X</strong> was chosen with probability <strong>1/(N-1)</strong> from the first <strong>(N-1)</strong> numbers. Since the N-th number in the sequence should have a 1/N probability of being the random number chosen among the first N numbers in the sequence, we decide if it is indeed the chosen random number with a probability of <strong>1/N</strong>. Suppose it were not, then the number <strong>X</strong> will be the random number chosen. We can verify its probability by noting that it is given by <strong>(1/(N-1))*((N-1)/N) = 1/N</strong>. Thus, we have the solution: for the <strong>i</strong>-th number in the sequence, choose it as the random number with probability <strong>1/i</strong>, otherwise, do not modify the previously chosen random number.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/geekygospel.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/geekygospel.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=31&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/06/12/interesting-cs-interview-questions-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Interesting CS Interview Questions #1</title>
		<link>http://geekygospel.wordpress.com/2008/06/10/interesting-cs-interview-questions-1/</link>
		<comments>http://geekygospel.wordpress.com/2008/06/10/interesting-cs-interview-questions-1/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 09:07:09 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Problem]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[binary tree]]></category>
		<category><![CDATA[C program]]></category>
		<category><![CDATA[Complexity]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[interviews]]></category>
		<category><![CDATA[linked lists]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[SDT]]></category>
		<category><![CDATA[software development engineer]]></category>
		<category><![CDATA[Space complexity]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[Time complexity]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=30</guid>
		<description><![CDATA[I&#8217;ve been through a lot of CS interviews recently and so I have come across many interesting problems. I find many of them worth sharing. So I am writing this short series of posts on this topic. All of these interviews were for a job post of Software Development Engineer. If you happen to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=30&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been through a lot of CS interviews recently and so I have come across many interesting problems. I find many of them worth sharing. So I am writing this short series of posts on this topic. All of these interviews were for a job post of Software Development Engineer. If you happen to be reading this, as a sort of preparation for an interview, I suggest you attempt to solve the problem yourself and then see how you like my solution (please correct me for any mistakes!). Most interviewers also ask for code. I am not posting that here, since after getting the solution, coding it should be fairly straightforward with a little practice.</p>
<p><span style="text-decoration:underline;"><strong>Given a binary tree, how will you convert it into a doubly-linked circular list in-place? That is, the left-child and right-child pointers of a node in the tree should be considered as left-node and right-node pointers in the doubly-linked list.</strong></span></p>
<p>The key here is that only a constant amount of extra space is allowed as the conversion should be performed in-place. That is, we cannot save the data in another, more convenient data structure and then perform the conversion to a linked list.</p>
<p>An important tip is to think of recursive algorithms when faced with problems about trees and especially binary trees.</p>
<p>Using this tip, we think of solving this problem recursively. When we are given the binary tree, what we are actually given is the head pointer of the tree. Thus, we have the head node, say <strong><em>head</em></strong>. We also immediately have the head nodes of the left and right subtrees of this node (<em><strong>head-&gt;left</strong></em> and <em><strong>head-&gt;right</strong></em>, using C-like notation). Now, we can simply solve the problem recursively. Thus, we can get the following pseudo-code:</p>
<blockquote><p>getDLL(head):<br />
[Takes the head pointer of a tree, and returns a circular DLL as required above containing the nodes in the given tree.]</p>
<ol>
<li>save = head</li>
<li>leftList = getDLL(head-&gt;left)</li>
<li>rightList = getDLL(head-&gt;right)</li>
<li>Now, combine the above, in-order: (leftList, save, rightList). Don&#8217;t forget to make it circular by joining the first and the last nodes.</li>
</ol>
</blockquote>
<p>Note that I have not handled the base cases. I am just illustrating the idea. Clearly, the base cases to consider are when either of the sub-trees are empty. If, so just return whatever list is remaining, without adding any null nodes.</p>
<p>Ok, now that you&#8217;ve understood the solution, don&#8217;t think it&#8217;s over. Analyse the complexity. <strong>Time complexity</strong> is linear in the number of nodes in the tree, i.e. O(N), where N is the number of nodes in the tree. Why? In each, recusive call, the amount of work done other than the recursive calls is constant. [If you are not convinced, complete the code and see for yourself.] Also the number of recursive calls equals the number of nodes. Thus, the result. What is the <strong>space complexity</strong>? It is not constant because recursion uses the stack. How much space is that?! The maximum size of the stack is proportional to the depth of the tree (why??). <em>I don&#8217;t yet know a solution that eliminates this logarithmic space requirement.</em></p>
<p><span style="text-decoration:underline;"><strong>It is known that when function calls are made, activation records are created and pushed on top of a stack, which is managed by the operating system. In some systems the stack grows upwards and on some other systems the stack grows downwards. How will you find out if a stack grows upwards or downwards for a program on a particular computer?</strong></span></p>
<p>This problem is actually pretty easy if you think about it. You are being asked to find if the address of elements of the activation record increase or decrease with nested function calls. The solution is to write a simple C program that saves the address of a local variable (as it is stored on the stack) in a global variable and then this information can be used in the main function, to determine if the stack grows up or down:</p>
<blockquote>
<pre>#include &lt;stdio.h&gt;</pre>
<pre>int a,b;</pre>
<pre>void f(){</pre>
<pre>       int b; a = &amp;b;</pre>
<pre>}</pre>
<pre>void main(){</pre>
<pre>       int c; b = &amp;c;</pre>
<pre>       f();</pre>
<pre>       if(a&gt;b) { /*Stack grows down*/ }</pre>
<pre>       else { /*Stack grows up*/ }</pre>
<pre>}</pre>
</blockquote>
<p><span style="text-decoration:underline;"><strong>Consider the following code snippets:</strong></span></p>
<blockquote><p>for(int i=0;i&lt;100;i++) for(int j=0;j&lt;1000;j++) ;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>and,</strong></span></p>
<blockquote><p>for(int j=0;j&lt;1000;j++) for(int i=0;i&lt;100;i++) ;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>Disregarding all compiler and processor level optimizations, which of these two codes runs faster? Why?</strong></span></p>
<p>It seems like a nasty puzzle, but the answer is actually pretty simple. We note that all constituent assembly level instructions are of the types: zero assignment, increment, comparison and jump. Let us count them. The first snippet has 101 zero assignment statements, 100,000 increment statements, 1001*100+101 = 100,201 comparison and jump statements. The second snippet has 1001 zero assignment statements, 100,000 increment statements, 1000*101+1001 = 102,001 comparison and jump statements. Clearly, the first one is faster.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/geekygospel.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/geekygospel.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=30&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/06/10/interesting-cs-interview-questions-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>
	</item>
		<item>
		<title>Lets spread Firefox!</title>
		<link>http://geekygospel.wordpress.com/2008/05/30/lets-spread-firefox/</link>
		<comments>http://geekygospel.wordpress.com/2008/05/30/lets-spread-firefox/#comments</comments>
		<pubDate>Fri, 30 May 2008 20:39:17 +0000</pubDate>
		<dc:creator>imdonatello</dc:creator>
				<category><![CDATA[Free and Open Source]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[download day]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firefox myths]]></category>
		<category><![CDATA[spreadfirefox]]></category>

		<guid isPermaLink="false">http://geekygospel.wordpress.com/?p=29</guid>
		<description><![CDATA[
Download Day 2008 will soon be unveiled and hundreds of thousands of people will prepare to download Firefox 3! The higher the number of people who download, the higher the chances of setting a Guinness World Record. Read more about it by clicking the image above.
Though, Firefox is being pushed as a great browser (and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=29&subd=geekygospel&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.spreadfirefox.com/en-US/worldrecord"><img src="http://www.spreadfirefox.com/sites/all/themes/spreadfirefox_RCS/images/download-day/buttons/en-US/dday_badge_fox.png" border="0" alt="Download Day 2008" /></a></p>
<p>Download Day 2008 will soon be unveiled and hundreds of thousands of people will prepare to download Firefox 3! The higher the number of people who download, the higher the chances of setting a Guinness World Record. Read more about it by clicking the image above.</p>
<p>Though, Firefox is being pushed as a great browser (and it no doubt is), let us not forget that it is also like any software subject to bugs. There does seem to be a sort of careless piece of confidence running around (&#8220;If I use Firefox, I am pretty much secure from viruses&#8221;, &#8220;Firefox is very secure&#8221;, etc), and this is very wrong. Let&#8217;s be alert and know that Firefox like any other piece of software is not infallible and is <a href="http://firefoxmyths.com">actually far from it</a>. So don&#8217;t spread Firefox for the wrong reasons! Don&#8217;t let people think that they are invulnerable because they use Firefox! People should learn that it is always part of their responsibility to remain alert and not get complacent with security.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/geekygospel.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/geekygospel.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/geekygospel.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/geekygospel.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/geekygospel.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/geekygospel.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/geekygospel.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/geekygospel.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/geekygospel.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/geekygospel.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/geekygospel.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/geekygospel.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=geekygospel.wordpress.com&blog=3457732&post=29&subd=geekygospel&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://geekygospel.wordpress.com/2008/05/30/lets-spread-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/add6d64a86a1877e6d20a0ac22bb8605?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">imdonatello</media:title>
		</media:content>

		<media:content url="http://www.spreadfirefox.com/sites/all/themes/spreadfirefox_RCS/images/download-day/buttons/en-US/dday_badge_fox.png" medium="image">
			<media:title type="html">Download Day 2008</media:title>
		</media:content>
	</item>
	</channel>
</rss>