<?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>The Viamentis Blog &#187; Uncategorized</title>
	<atom:link href="http://blog.viamentis.com/articles/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.viamentis.com</link>
	<description>Curious About Everything</description>
	<lastBuildDate>Mon, 12 Jul 2010 11:16:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>dict.org client with Ruby Shoes</title>
		<link>http://blog.viamentis.com/articles/2008/05/02/dictorg-client-with-ruby-shoes/</link>
		<comments>http://blog.viamentis.com/articles/2008/05/02/dictorg-client-with-ruby-shoes/#comments</comments>
		<pubDate>Fri, 02 May 2008 09:44:52 +0000</pubDate>
		<dc:creator>unni</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/05/02/dictorg-client-with-ruby-shoes/</guid>
		<description><![CDATA[While reading blogs and other online documents, emails etc, I always come across words whose meaning is not known to me. Usually I lookup these words using Ubuntu&#8217;s Dictionary application . Copying the word, pasting it in the text field of the dictionary app, hitting &#8220;Search&#8221;, and then waiting for results &#8211; this was proving [...]]]></description>
			<content:encoded><![CDATA[<p>While reading blogs and other online documents, emails etc, I always come across words whose meaning is not known to me. Usually I lookup these words using Ubuntu&#8217;s Dictionary application . Copying the word, pasting it in the text field of the dictionary app, hitting &#8220;Search&#8221;, and then waiting for results &#8211; this was proving to be a difficult process, as I have to do it very often. Today morning Vamsee told me about <a href="http://www.dict.org/bin/Dict">dict.org</a> and that it has an API. So I thought of using <a href="http://www.rfc-editor.org/rfc/rfc2229.txt">dict.org&#8217;s API</a> to build a tiny application that would help me lookup unknown words easily, preferably in a single step.</p>
<p>dict.org follows the standard Dictionary protocol. One could connect with TCP to &#8216;dict.org&#8217; at 2628, and use the requests specified in the protocol to lookup words.</p>
<blockquote><p>telnet dict.org 2628<br />
Trying 72.36.131.187&#8230;<br />
Connected to dict.org.<br />
Escape character is &#8216;^]&#8217;.<br />
220 aspen.miranda.org dictd 1.9.15/rf on Linux 2.6.18-6-k7 &lt;auth.mime&gt; &lt;13095488.4831.1209719617@aspen.miranda.org&gt;</p>
<p>DEFINE english freedom<br />
150 10 definitions retrieved<br />
151 &#8220;Freedom&#8221; gcide &#8220;The Collaborative International Dictionary of English v.0.48&#8243;<br />
Freedom \Free&#8221;dom\ (fr[=e]&#8220;d[u^]m), n. [AS. fre['o]d[=o]m;<br />
fre['o]free + -dom. See {Free}, and {-dom}.]<br />
1. The state of being free; exemption from the power and<br />
control of another; liberty; independence.<br />
[1913 Webster]</p></blockquote>
<p>But most of the languages already have dict.org API wrappers. A list is given <a href="http://www.dict.org/links.html">here</a>. I tried the Ruby and Python APIs, they are pretty straight forward. I also found a &#8216;dict&#8217; program, which is a dict.org client.</p>
<p><code>sudo apt-get install dict</code></p>
<p>$ dict <em>freedom</em></p>
<p>It dumps the meaning of the word as well as similar words from thesaurus on to the terminal. Now my idea was to build a simple GUI to &#8216;dict&#8217;. To do it in a flash, i decided to use <a href="http://code.whytheluckystiff.net/shoes/">Ruby Shoes</a>, a light weight GUI tool kit in Ruby. More about Shoes and its installation can be read from <a href="http://blog.viamentis.com/articles/2008/04/04/shoes-a-ruby-gui-toolkit/">Divya&#8217;s article on Shoes</a>.</p>
<p>First step was to create a Ruby interface for dict.org using the &#8216;dict&#8217; client.</p>
<blockquote><p><strong>IO.popen(&#8220;dict #{word}&#8221;).read</strong></p></blockquote>
<blockquote></blockquote>
<p>Now using this interface, I made a normal dictionary application using Shoes &#8211; one with a text field and search button. On clicking the button, the word in the text field will be looked using dict aand result will be displayed in the window. It worked well, but it did not have any advantage over the dictionary application already available with Ubuntu. I wanted the  whole lookup process to happen seamlessly for the user, disturbing his reading flow as less as possible.</p>
<p>So i decided to use the <strong>clipboard</strong>. User now simply has to select a word. My program will <em> </em>pick it up from clipboard and lookup the word in dict.org and have the meaning, thesaurus and other details ready in a flash. All the user has to do is to select a word..!</p>
<p>My dict.org client with Ruby shoes is available <a href="http://blog.viamentis.com/wp-content/uploads/2008/05/dict.rb">here</a>.</p>
<p>You can run it like this :</p>
<p><code>$ shoes dict.rb</code></p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/05/02/dictorg-client-with-ruby-shoes/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/05/02/dictorg-client-with-ruby-shoes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unni&#8217;s article gets featured in LinuxGazette</title>
		<link>http://blog.viamentis.com/articles/2008/04/04/unnis-article-gets-featured-in-linuxgazette/</link>
		<comments>http://blog.viamentis.com/articles/2008/04/04/unnis-article-gets-featured-in-linuxgazette/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 04:48:40 +0000</pubDate>
		<dc:creator>Vamsee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux gazette]]></category>
		<category><![CDATA[unni]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/04/04/unnis-article-gets-featured-in-linuxgazette/</guid>
		<description><![CDATA[As you might notice, my blogging has gone down a bit &#8211; and you might have also observed that there are lot more posts by Unni &#38; Divya, my colleagues. Chalk that up to new projects, and lots of higher priority items. I&#8217;m slowly coming to realize, running an actual business is not so easy [...]]]></description>
			<content:encoded><![CDATA[<p>As you might notice, my blogging has gone down a bit &#8211; and you might have also observed that there are lot more posts by Unni &amp; Divya, my colleagues. Chalk that up to new projects, and lots of higher priority items. I&#8217;m slowly coming to realize, running an actual business is not so easy as they make it sound. But, it&#8217;s an amazing ride, for sure.</p>
<p>Coming to the point, I encourage our developers to take some time off at least once every week and do something they think is fun. Yes, it&#8217;s very much based on Google&#8217;s 20% time, but we try to make it a group event rather than an individual one. And Unni comes up with some pretty fun projects. One such project, which he blogged about here, was recently featured in <a href="http://linuxgazette.net/149/unnikrishnan.html">LinuxGazette</a>. He might be too modest to post about it here, so I&#8217;m doing it for him <img src='http://blog.viamentis.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (check out the editor&#8217;s comment &#8211; pretty funny).</p>
<p>Good stuff guys, keep going.</p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/04/04/unnis-article-gets-featured-in-linuxgazette/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/04/04/unnis-article-gets-featured-in-linuxgazette/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JuggerNaut &#8211; Push Server for Rails</title>
		<link>http://blog.viamentis.com/articles/2008/03/14/juggernaut-push-server-for-rails/</link>
		<comments>http://blog.viamentis.com/articles/2008/03/14/juggernaut-push-server-for-rails/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 11:47:52 +0000</pubDate>
		<dc:creator>unni</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/03/14/juggernaut-push-server-for-rails/</guid>
		<description><![CDATA[When we build a web page that contains data which gets updated very frequently (eg: Share price of Google, or score of a live cricket match), it would be extremely useful if we could &#8216;push&#8217; data into the webpage, without the user having to &#8216;pull&#8217; the data by reloading the page or requesting explicitly. Juggernaut [...]]]></description>
			<content:encoded><![CDATA[<p>When we build a web page that contains data which gets updated very frequently (eg: Share price of Google, or score of a live cricket match), it would be extremely useful if we could &#8216;push&#8217;  data into the webpage, without the user having to &#8216;pull&#8217; the data by reloading the page or requesting explicitly.<br />
<a href="http://cometd.com/"></a></p>
<p><a href="http://juggernaut.rubyforge.org/">Juggernaut</a> is a Ruby on Rails plugin that helps to implement this &#8216;push&#8217; mechanism. <a href="http://cometd.com/">Comet</a> is the widely accepted technology for doing the same. Juggernaut claims to have a few advantages over comet. Details can be found <a href="http://ajaxian.com/archives/juggernaut-comet-for-rails">here</a>.</p>
<p>Apart from the Rails application, juggernaut runs a separate push server, which maintains persistent socket connection with all connected clients. Ruby app sends data to this push server, which pushes the data to all connected clients.</p>
<p>Juggernaut  initiates a flash xmlsocket between server and browser allowing real time communication between the two. The open socket connection allows the server to â€˜pushâ€™ base64 encoded javascript to the browser which is subsequently decoded and evaluated.</p>
<p><a href="http://blog.viamentis.com/wp-content/uploads/2008/03/juggernaut.jpg" title="juggernaut.jpg"><img src="http://blog.viamentis.com/wp-content/uploads/2008/03/juggernaut.jpg" alt="juggernaut.jpg" /></a></p>
<p>Installation and configuration of Juggernaut are explained in detail in the <a href="http://juggernaut.rubyforge.org/svn/trunk/juggernaut/README">Juggrenaut page</a>.</p>
<p>I tried to build a simple Juggernaut-Rails application that would push the current playing song name in my system(rails app runs on the same machine). It was fairly simple, current playing song name was extracted using the Dbus interface of Rhythmbox music player (More details on this can be found in my <a href="http://blog.viamentis.com/articles/2008/02/08/ipc-with-d-bus-in-linux/">article on IPC with Dbus</a>.  Once the <em>songname  </em>was obtained, pushing it to the browsers required only the following code in the controller:</p>
<pre> render :juggernaut do |page|
      page.replace_html 'song_name', "&lt;b&gt; #{song_name} &lt;/b&gt;"
 end</pre>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/03/14/juggernaut-push-server-for-rails/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/03/14/juggernaut-push-server-for-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Keyboard lights &amp; Ruby</title>
		<link>http://blog.viamentis.com/articles/2008/02/20/keyboard-lights-ruby/</link>
		<comments>http://blog.viamentis.com/articles/2008/02/20/keyboard-lights-ruby/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 09:33:42 +0000</pubDate>
		<dc:creator>unni</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.viamentis.com/articles/2008/02/20/keyboard-lights-ruby/</guid>
		<description><![CDATA[I happened to see a ruby library called Blinkenlights, which helps to control the three LEDs (Caps lock, Scroll lock &#38; Num lock) on keyboards. I have written few simple programs to play with the keyboard LEDs &#8211; basically simulation of three experiments I did in my Digital Electronics lab &#8211; Binary Counter, Ring Counter [...]]]></description>
			<content:encoded><![CDATA[<p>I happened to see a ruby library called <a href="http://rubyforge.org/projects/blinkenlights/">Blinkenlights,</a> which helps to control the three LEDs (Caps lock, Scroll lock &amp; Num lock) on keyboards. I have written few simple programs to play with  the keyboard LEDs &#8211; basically simulation of three experiments I did in my Digital Electronics lab &#8211; Binary Counter, Ring Counter &amp;  Johnson Counter.</p>
<p><code>sudo gem install blinkenlights</code></p>
<p><u>Binary Counter</u></p>
<p>A counter that counts from 0 to 7 in binary, using the three LEDs as three bits. 0(000) &#8211; All LEDs will be turned off, and 7(111) all of them turned ON.<br />
<a href="http://blog.viamentis.com/wp-content/uploads/2008/02/counter.rb">counter.rb</a></p>
<p>super user privilege is required to access the keyboard, so run it as</p>
<p><code>sudo ruby counter.rb</code></p>
<p><u>Ring Counter</u></p>
<p>Starting with 4 (100), we right shift to get 2 (010), again right shift to get 1(001), and then start over again with 4. This causes the keyboard LEDs to turn ON and then OFF one by one.</p>
<p><a href="http://blog.viamentis.com/wp-content/uploads/2008/02/ringcounter.rb">ringcounter.rb</a></p>
<p><u>Johnson Counter</u></p>
<p>This is the Johson counter sequence : 000,001,011,111,110,100,000,001,&#8230;</p>
<p><a href="http://blog.viamentis.com/wp-content/uploads/2008/02/johnsoncounter.rb">johnsoncounter.rb</a></p>
<div id="pfButton"><a href="http://blog.viamentis.com/articles/2008/02/20/keyboard-lights-ruby/?pfstyle=wp" title="Print an optimized version of this web page"><img id="printfriendly" style="border:none; padding:0;" src="http://cdn.printfriendly.com/pf-button-both.gif" alt="Print"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.viamentis.com/articles/2008/02/20/keyboard-lights-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
