<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>KalyanChakravarthy.net</title>
	
	<link>http://kalyanchakravarthy.net</link>
	<description>kalyanchakravarthy.net - Kalyan's Weblog, Rantings, Projects, Designs....and more blah</description>
	<lastBuildDate>Tue, 16 Oct 2012 16:18:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Kalyanchakravarthynet" /><feedburner:info uri="kalyanchakravarthynet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Inverted Snakes</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/avW5TBzxFnQ/</link>
		<comments>http://kalyanchakravarthy.net/?p=602#comments</comments>
		<pubDate>Tue, 16 Oct 2012 16:12:23 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[snake]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=602</guid>
		<description><![CDATA[<p>Everyone has played classic snake, be it on mobile, online, gameboy, whatever. If you have not, drop everything, I mean everything, including your heartbeat if possible and get on and play it.</p>
<p>Invertes snakes is a Javascript/Canvas implementation of Classic&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>Everyone has played classic snake, be it on mobile, online, gameboy, whatever. If you have not, drop everything, I mean everything, including your heartbeat if possible and get on and play it.</p>
<p>Invertes snakes is a Javascript/Canvas implementation of Classic Snake with a twist &#8211; There are 2 snakes Red and Blue &#8211; You only control one snake, the 2nd one just mirrors your movement. The food for snakes alternate between Red &amp; Blue, each snake only eats its colored food.</p>
<p>Rules are simple</p>
<ul>
<li>You don&#8217;t die by crashing. You die on timeout</li>
<li>Red snake eats red food. Blue Snake eats Blue Food.</li>
<li>You always control RED snake.</li>
<li>You start with 30 seconds</li>
<li>Food gets you +10 seconds &amp; +100 points.</li>
<li>Post your scores in the comments below <img src='http://kalyanchakravarthy.net/tech/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p><a href="http://kalyanchakravarthy.net/projects/fun/invertedsnakes/index.html">Demo &amp; Javascript Source</a></p>
<p><a href="http://kalyanchakravarthy.net/projects/fun/invertedsnakes/index.html"><img class="aligncenter size-large wp-image-605" title="Inverted Snakes" src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2012/10/inverted-snakes-2-520x365.png" alt="" width="520" height="365" /></a></p>
<p>&nbsp;</p>
<p>Note: Some of Chrome&#8217;s plugins may cause &lt;space&gt; to not star the game. Try playing the game in another browser or disable your plugins.</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/avW5TBzxFnQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=602</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=602</feedburner:origLink></item>
		<item>
		<title>Tetris in Javascript and Canvas</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/YDPb3bDIarY/</link>
		<comments>http://kalyanchakravarthy.net/?p=582#comments</comments>
		<pubDate>Tue, 14 Feb 2012 01:30:22 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[tetris]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=582</guid>
		<description><![CDATA[<dl class="wp-caption alignleft" style="margin-left: 5px; padding: 5px; border: 1px solid #555;">
<dt class="wp-caption-dt"><a href="http://kalyanchakravarthy.net/projects/fun/jstris/"><img class="size-medium wp-image-584" title="Tetris." src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2012/02/jstris-150x150.jpg" alt="" width="150" height="150" /></a></dt>
</dl>
<p>I love tetris. I have never written tetris before and I have always wanted to. Attempted it once but couldn&#8217;t figure out heads and tails of&#8230;</p>]]></description>
				<content:encoded><![CDATA[<dl class="wp-caption alignleft" style="margin-left: 5px; padding: 5px; border: 1px solid #555;">
<dt class="wp-caption-dt"><a href="http://kalyanchakravarthy.net/projects/fun/jstris/"><img class="size-medium wp-image-584" title="Tetris." src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2012/02/jstris-150x150.jpg" alt="" width="150" height="150" /></a></dt>
</dl>
<p>I love tetris. I have never written tetris before and I have always wanted to. Attempted it once but couldn&#8217;t figure out heads and tails of it and then left at it. I wanted to get over it.</p>
<p>So i wrote it, in less than 4 hours (bragging rights) in JavaScript using canvas. Feel free to browse the source or Play it here</p>
<p><a href="http://kalyanchakravarthy.net/projects/fun/jstris/">http://kalyanchakravarthy.net/projects/fun/jstris/</a></p>
<p>&nbsp;</p>
<p>During the process I learnt how to use the javascript &#8220;with()&#8221;. Despite all the cliches around it, I feel its a pretty awesome and useful language feature. It logically made sense to use it to group statements together, especially the drawing functions.</p>
<pre><code lang="javascript">with( stage.ctx ) {
	fillStyle = "#fff";
	fillRect( theX+1, theY+1, stage.cellSize-2, stage.cellSize-2 );
	fill();
}
</code></pre>
<p>Ain&#8217;t that neater than this?</p>
<pre><code lang="javascript">stage.ctx.fillStyle = "#fff";
stage.ctx.fillRect( theX+1, theY+1, stage.cellSize-2, stage.cellSize-2 );
stage.ctx.fill();
</code></pre>
<p>Imagine doing it for 20-30 statements.</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/YDPb3bDIarY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=582</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=582</feedburner:origLink></item>
		<item>
		<title>Anonymous functions in Javascript</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/BVIzadD9n_Y/</link>
		<comments>http://kalyanchakravarthy.net/?p=565#comments</comments>
		<pubDate>Tue, 14 Feb 2012 00:14:56 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[language play]]></category>
		<category><![CDATA[quirks]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=565</guid>
		<description><![CDATA[<p>We all know the usual way to create anonymous functions is to write something like this</p>
<pre><code>(function() {
 alert('hello');
})();</code></pre>
<p>I recently learnt this works too (#1)</p>
<pre><code>!function() {
 alert('hello');
}(); </code></pre>
<p>But interestingly enough that same code, without the&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>We all know the usual way to create anonymous functions is to write something like this</p>
<pre><code>(function() {
 alert('hello');
})();</code></pre>
<p>I recently learnt this works too (#1)</p>
<pre><code>!function() {
 alert('hello');
}(); </code></pre>
<p>But interestingly enough that same code, without the !, throws a syntax error. (#2)</p>
<pre><code>function() {
 alert('hello'); 
}(); </code></pre>
<p>This had me stoked for a while until I realized why and it was obvious all along.</p>
<p>In the first case the &#8220;!&#8221; makes the function be treated as an anonymous function object and then negating it to result false after it has executed. But in the #2, the absence of an expression and starting of the statement with &#8216;function&#8217; keyword makes the interpreter look for a named function, which it wouldn&#8217;t qualify for due to the absence of a name, thereby resulting in syntax error.</p>
<p>The same piece of code in the context of an expression, works just fine</p>
<pre><code>&gt; x = function() { return 10; }(); 
&gt; x
 10 
</code></pre>
<p>So, will naming work? Yes.</p>
<pre><code>//Naming works too
&gt; x = function xyz() { return 15; }(); 
&gt; x
 15 
</code></pre>
<p>Can we call it outside an expression without grouping? No. That would throw an error, as after consuming a fully formed function, the interpreter tries to consider the empty anonymous parenthesis as a different statement.</p>
<pre><code>&gt; function xyz() { return 15; }();  //error
&gt; ();  //error</code></pre>
<p>Make the empty parenthesis a valid statement, and it works</p>
<pre><code>&gt; function xyz() { return 15; }(1);
</code></pre>
<p>How do we know its an independent statement?</p>
<pre><code>&gt; function xyz() { return 15; }(console.log(20));
&gt; 20</code></pre>
<p>But then how do we call it ? By Grouping.</p>
<pre><code>&gt; (function xyz() { return 15; })(console.log(20));
&gt; 20  //console log
&lt;- 15  //return
</code></pre>
<p>Why does it work? The function instead of being a simple statement, now is an object in an expression, which means can be evaluated and can take arguments.</p>
<p>But arguments need not be an expression and can be empty. That brings us back to the standard statement.</p>
<pre><code>&gt; (function xyz() { return 15; })();
&lt;- 15  //return
</code></pre>
<p>Interesting language JavaScript is.</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/BVIzadD9n_Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=565</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=565</feedburner:origLink></item>
		<item>
		<title>Detecting multiple arrow key strokes</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/Qy-6i4-nr_c/</link>
		<comments>http://kalyanchakravarthy.net/?p=546#comments</comments>
		<pubDate>Sun, 06 Nov 2011 15:23:46 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=546</guid>
		<description><![CDATA[<p>Most games or applications which make use of arrow keys, sometimes require the use of multiple combinations like UP+RIGHT, LEFT+DOWN, etc also. I was trying to do the same for a 3d game I was trying to write in Processing.&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>Most games or applications which make use of arrow keys, sometimes require the use of multiple combinations like UP+RIGHT, LEFT+DOWN, etc also. I was trying to do the same for a 3d game I was trying to write in Processing. It might seem like a simple problem, which it is, surprisingly i couldn&#8217;t find anything on it. So after playing around with a little bit i figured it out.</p>
<p>Each key when pressed and released individually triggers a separate event, including for combinations of keys. Hence the way to test if both Up+Right keys are pressed, is to store the pressed status of individual keys, and clear their status individually when each key is released.</p>
<p>Here is the processing code. The logic should be applicable for any language and platform.</p>
<pre><code lang="processing">
class KeyStateReader {
  //binary sequence for easy state storage
  static final int K_UP = 1;
  static final int K_RIGHT = 2;
  static final int K_DOWN = 4;
  static final int K_LEFT = 8;

  int keyState;

  //combine the key stats into single variable by logical |
  public void onKeyPress() {
    int kType = getK();
    keyState |= kType;
  }
  //on release clear individual bits
  public void onKeyRelease() {
    int kType = getK();
    keyState = keyState ^ kType;
  }
  // pass a key combo using logical or '|' ( UP | RIGHT ) to see if it exists. 
  public boolean isKey(int k) {
    return (k &amp; keyState) != 0 ? true : false;
  }
  // do we have any at all ?
  public boolean hasAnyKey() {
    return keyState &gt; 0;
  }

  public int getK() {
    switch(keyCode) {
      case UP: return K_UP;
      case DOWN: return K_DOWN;
      case LEFT: return K_LEFT;
      case RIGHT: return K_RIGHT;
    }
    return -1;
  }
}

KeyStateReader keyState = new KeyStateReader();
void keyPressed() {
  keyState.onKeyPress();
}
void keyReleased() {
  keyState.onKeyRelease();
}</code></pre>
<p>To check for key combos you can now do this</p>
<pre><code lang="processing">void checkKeyCombo() {
  // for UP+RIGHT
  if( keyState.isKey( KeyStateReader.K_UP | KeyStateReader.K_RIGHT ) ) {
    do_something_up_right();
  }
  // You can even check them individually
  if( keyState.isKey( KeyStateReader.K_UP ) ) {
    do_something_up();
  }
  if( keyState.isKey( KeyStateReader.K_RIGHT ) ) {
    do_something_right();
  }
}</code></pre>
<p>There are definitely other ways to do it too, like maintain an array with all the keyCodes and check if the key being tested is available in the array. That way you will be able to track multiple keys and you wouldn&#8217;t have to re-define key codes for each of them.</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/Qy-6i4-nr_c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=546</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=546</feedburner:origLink></item>
		<item>
		<title>RSS Feed for Flickr Explore</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/5NJ30twApQ4/</link>
		<comments>http://kalyanchakravarthy.net/?p=536#comments</comments>
		<pubDate>Tue, 25 Oct 2011 11:42:29 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[explore]]></category>
		<category><![CDATA[feeds]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[subscrive]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=536</guid>
		<description><![CDATA[<p>Am a big fan of Google Reader and have subscribed to hundreds of RSS feeds. I love browsing through Flickr. I am addicted to it, especially to their explore section, where daily they come up with few hundred most interesting&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>Am a big fan of Google Reader and have subscribed to hundreds of RSS feeds. I love browsing through Flickr. I am addicted to it, especially to their explore section, where daily they come up with few hundred most interesting photos from flickr for that day.</p>
<p>So I wrote a PHP Script which generates an RSS feed of the 100 most interesting photos on <a href="http://flickr.com/explore">Flickr&#8217;s explore</a>, every single day via a cron job which uses Flickr API and a bit of cUrl magic. A 100 photos are published to the RSS Feed, every-single-day. The explore positions vary through out the day, but only those that appear to the script when it runs are considered.</p>
<p>Every single day I go through those photos, I am left inspired and mesmerized. There are so many amazing photographers out there, that simply watching their work is a delight. It just makes my day. Here is the Feed URL for you to subscribe for your photography delight.</p>
<p><code><strong>Feed URL</strong> - <a href="http://feeds.feedburner.com/Flickr-Daily-100-Interesting">http://feeds.feedburner.com/Flickr-Daily-100-Interesting</a></code></p>
<p>You can use any Feed Reader you want. If you are not sure I would recommend Google Reader.</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/5NJ30twApQ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=536</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=536</feedburner:origLink></item>
		<item>
		<title>Iteration number 22</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/dWdtH2SbTfk/</link>
		<comments>http://kalyanchakravarthy.net/?p=520#comments</comments>
		<pubDate>Sat, 09 Apr 2011 18:00:38 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Ramblings and Rantings]]></category>
		<category><![CDATA[Thoughts & Thoughts]]></category>
		<category><![CDATA[22]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[memoir]]></category>
		<category><![CDATA[rambling]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[todo]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=520</guid>
		<description><![CDATA[<p><a href="http://www.flickr.com/photos/kalyan02/5320231761/"><img title="In Perspective..." src="http://farm6.static.flickr.com/5165/5320231761_a016b0a6ca_z.jpg" alt="In Perspective..." width="525" /></a></p>
<p class="wp-caption-text"><a href="http://www.flickr.com/photos/kalyan02/5320231761/">In Perspective&#8230;</a><a href="http://www.flickr.com/photos/kalyan02/">kalyan02</a></p>
<p class="wp-caption-text"><em>(Posted for 2nd of April, My Birthday)</em></p>
<p>Life is like a loop, it goes on, and on, iterating through every passing year. This post, commemorates my 22nd one, which as a customary, I have done&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/kalyan02/5320231761/"><img title="In Perspective..." src="http://farm6.static.flickr.com/5165/5320231761_a016b0a6ca_z.jpg" alt="In Perspective..." width="525" /></a></p>
<p class="wp-caption-text"><a href="http://www.flickr.com/photos/kalyan02/5320231761/">In Perspective&#8230;</a><a href="http://www.flickr.com/photos/kalyan02/">kalyan02</a></p>
<p class="wp-caption-text"><em>(Posted for 2nd of April, My Birthday)</em></p>
<p>Life is like a loop, it goes on, and on, iterating through every passing year. This post, commemorates my 22nd one, which as a customary, I have done in the past too. It helps keep record, of what I wanted to do, what I have done, what I am going to do or atleast that which I thought I should do, leaving behind a trail of how I have changed. So a decade later, when I have the need to slap myself, I can go against my ego and do so, with proof.</p>
<p>Every year It feels I have come to fill the gap, a gap at which I seemed to have sucked at, an year back. I feel good, or almost, because before that happens, an introspective realization hits that its just another improvised gap, like suckiness in recursion, for the coming year. This observation has been quite consistent over the past 5 years. Or so I remember.</p>
<p>Each year that goes past, I consider myself to have become an year younger, a tradition which helps keep the spirit going, for I would have left some baggage behind, to move on, to look forward for things ahead in life. This time its different, I am 1 year older, truly, for the things I have been through, what I have picked up, can never be left behind, can never be forgotten, never be healed. And yet I seem to be looking forward and ahead in life, for the times that are yet to come. The only true way of healing grief is by accepting it and letting it become an integral part of what and who we are. That probably makes me an entirely different person, different to me atleast, different from what I was an year back. I think I have started to accept and embrace so drastic a change, for its the only way to survive life and live it. Its a significant milestone in life, one which I dearly wish I didn&#8217;t have to arrive at.</p>
<p>Photography has stuck on with me, for over 2 years, to become a serious hobby, my best friend, helping me, when in need, to come out, cope up, move on &amp; cheer up. It has helped me make memories few of which I would forever cherish, helped make new friends, talk to and interact with other people, with whom I might not have otherwise.  Have also picked up something which I thought I lost 10 years back, only to get much better at it &#8211; Sketching. That makes it 3 things, check &amp; done.</p>
<p>One of the things worthy of mentioning, that which has gone to change my way of thinking, my opinions, given a chance to make few new ones, to make some very strong &amp; to break a quite a few too, is a book, &#8220;Fountainhead by Ayn Rand&#8221;. Those who read the book, need no more explanation, those who haven&#8217;t, should read without asking for an explanation. It is the one book which made me truly believe that books have power to influence, change and redirect a person by 180 degrees, a change worth skipping all your meals for, in case you thought books aren&#8217;t worthy enough. Reading wise, read more than 20 books, which considering that I never took to reading before, is another check.</p>
<p>India won the Cricket World Cup 2011, co-incidentally on the B-day, thats one more thing, no two things, double check.</p>
<p>2 years back I earned myself a DSLR for my B&#8217;day, out of the freelancing gigs I did, way back at college. It changed my life. Last year I earned myself my very first job as a backend/web developer. It changed my life. This time, as a life experiment, despite knowing that I love the web, I put myself (or life made me to be exact) in a position which I have no idea how I would possibly handle, and the only way of knowing how I would, is when I am in it and have no choice &#8211; a shiny new job, as a C++ dev.</p>
<p>This has given me a new sense of feeling towards life, me the ego, myself as a person and the world around in general, which I shall want to keep to myself. With it, I seem to have gotten a better idea of what I would want to do and importantly what I don&#8217;t want to do, which if I have to, I atleast know how I should want to.</p>
<p>The usual ritual is to make huge list of resolutions, as the self-observed pattern says that 60% of them get completed in most cases. This time there are only few, most of which are the ones that overflowed from last year&#8217;s list, and few other newer personal ones, which to summarize are &#8211; Run, Draw, Shoot, Travel, Read, Meet, Speak, Express.</p>
<p><em>(Posted for 2nd of April, My Birthday)</em></p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/dWdtH2SbTfk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=520</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=520</feedburner:origLink></item>
		<item>
		<title>What matters?</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/eSfUvr-SxSs/</link>
		<comments>http://kalyanchakravarthy.net/?p=494#comments</comments>
		<pubDate>Tue, 25 Jan 2011 06:49:19 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Thoughts & Thoughts]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[knowledge]]></category>
		<category><![CDATA[sketch]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=494</guid>
		<description><![CDATA[<p>Knowledge weighs more than anything</p>
<p><a href="http://kalyanchakravarthy.net/?attachment_id=484" rel="attachment wp-att-484"><img src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0086-R-520x342.jpg" alt="" title="which side?" width="520" height="342" class="aligncenter size-large wp-image-484" /></a></p>
<p>And what matters is we strive to push our bounds for more of it&#8230;</p>
<p><a href="http://kalyanchakravarthy.net/?attachment_id=495" rel="attachment wp-att-495"><img src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0087-1-R-520x331.jpg" alt="" title="Push up!" width="520" height="331" class="aligncenter size-large wp-image-495" /></a></p>
<p>the first sketch was originally drawn for <a href='?p=483'>this post</a></p>
]]></description>
				<content:encoded><![CDATA[<p>Knowledge weighs more than anything</p>
<p><a href="http://kalyanchakravarthy.net/?attachment_id=484" rel="attachment wp-att-484"><img src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0086-R-520x342.jpg" alt="" title="which side?" width="520" height="342" class="aligncenter size-large wp-image-484" /></a></p>
<p>And what matters is we strive to push our bounds for more of it&#8230;</p>
<p><a href="http://kalyanchakravarthy.net/?attachment_id=495" rel="attachment wp-att-495"><img src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0087-1-R-520x331.jpg" alt="" title="Push up!" width="520" height="331" class="aligncenter size-large wp-image-495" /></a></p>
<p>the first sketch was originally drawn for <a href='?p=483'>this post</a></p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/eSfUvr-SxSs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=494</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=494</feedburner:origLink></item>
		<item>
		<title>Of learning and attitude</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/vrwGA-v5Ukw/</link>
		<comments>http://kalyanchakravarthy.net/?p=483#comments</comments>
		<pubDate>Mon, 24 Jan 2011 17:11:21 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Ramblings and Rantings]]></category>
		<category><![CDATA[Thoughts & Thoughts]]></category>
		<category><![CDATA[attitude]]></category>
		<category><![CDATA[debate]]></category>
		<category><![CDATA[discussing]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=483</guid>
		<description><![CDATA[<p><a href="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0086-R.jpg"><img src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0086-R-300x197.jpg" alt="" title="which side?" width="300" height="197" class="alignright size-medium wp-image-484" /></a></p>
<p>	Discussions are good. Debates are better. Great when they are impromptu. Awesome, when they are with people who have respectable amount of knowledge gained over many years. Splendid if it is at workplace, for it adds positive energy&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p><a href="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0086-R.jpg"><img src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/IMAG0086-R-300x197.jpg" alt="" title="which side?" width="300" height="197" class="alignright size-medium wp-image-484" /></a></p>
<p>	Discussions are good. Debates are better. Great when they are impromptu. Awesome, when they are with people who have respectable amount of knowledge gained over many years. Splendid if it is at workplace, for it adds positive energy to the environment, and forms a perfect ground for having an intelligent conversation. The one having naive ideas gets corrected and directed. One with more knowledge knows the other persons perspective. One who has no idea, has an opportunity to learn about both the sides of the argument, that if they were to show atleast a tiny bit of interest, a pretty big IF. Its a perfect win-win-win situation to be in, if take in the right stride.</p>
<p>	For if they aren&#8217;t, they only add up negative value to the environment, by discouraging the lower peer, passing comments around in numerous ways which certainly aren&#8217;t productive for anyone. Such people neither are interested to learn nor they suck it up. There is no excuse to not put on headphones and get cracking with their work, when they are provided with a laptop, with high speed internet, by streaming music or any other form of distractive concentration they may want, rather than whine about how much they are being distracted, without noting the fact that they are actually wasting more time by IM&#8217;ing others to pass those comments, some of which go out of the way to provoke by calling mannerless pets who are creatures unconcerned about violating their its-just-another-job bubble, as if it were equivalent to a Hiroshima attack.</p>
<p>	One may be good at something, gets things done, and not concerned about anything else, like slaves. But slaves never change anything, not for themselves, not for others. Sure it may get them an increment, better rating, a promotion, but for what? To become a better slave? Such attitude won&#8217;t make them any better, unless they strive to learn something, something new and do something differently. A 2 year old who strives to learn is always better than a 10-year-old slave who just wants the day to end. For learners are the ones who will invent, who will change the way things are done, or perhaps even change the world.</p>
<p>	There is no boasting or bias on my part. I don&#8217;t claim to be any better than anyone. For I know, know it well and accept it all, that I am young and most or all of the billion ideas and opinions that I have are naive. I am just trying to change that. I just want to learn, become less naive, and a better person, consume in every drop of knowledge I can find, drink it like I haven&#8217;t had a drop, for there are more things to learn in this world then we have time for, so much so that one lifetime is just not enough. If I can, I would try to help anyone with as much little as I can, the way I am being helped. And I certainly would remember to suck it up when its my turn, which I did when I got few concepts explained by a junior. Being a wannabe-[better]-person is not a bad thing. It’s an awesome thing, when effort is being made. Its not how people look at, make me feel or treat that bothers me, for I don&#8217;t give a rats ass. It’s the sometimes lame-attacking and know-it-all attitude that people show towards others in general that worries me. </p>
<p>	Not everyone is same, definitely not. But if one is neither trying to be a better person nor letting others, let alone adding positive value, what’s the point?</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/vrwGA-v5Ukw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=483</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=483</feedburner:origLink></item>
		<item>
		<title>Emptyvesselism</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/uxUGx6SrxqY/</link>
		<comments>http://kalyanchakravarthy.net/?p=461#comments</comments>
		<pubDate>Thu, 13 Jan 2011 21:02:51 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Thoughts & Thoughts]]></category>
		<category><![CDATA[disease]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Rambing]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=461</guid>
		<description><![CDATA[<dl id="attachment_465" class="wp-caption alignright" style="width: 211px;margin-left:5px;padding:5px;border:1px solid #555">
<dt class="wp-caption-dt"><a href="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/empty-vessel.jpg"><img class="size-medium wp-image-465" title="Empty vessel." src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/empty-vessel-211x300.jpg" alt="" width="211" height="300" /></a></dt>
<div class="wp-caption-dd" style="display:block;text-align:center">Empty-Vessel. Pencil sketch</div>
</dl>
<p>Let me introduce to you the another class of so called humans known as &#8211; Attention craving zombies! They belong to an advanced generation&#8230;</p>]]></description>
				<content:encoded><![CDATA[<dl id="attachment_465" class="wp-caption alignright" style="width: 211px;margin-left:5px;padding:5px;border:1px solid #555">
<dt class="wp-caption-dt"><a href="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/empty-vessel.jpg"><img class="size-medium wp-image-465" title="Empty vessel." src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2011/01/empty-vessel-211x300.jpg" alt="" width="211" height="300" /></a></dt>
<div class="wp-caption-dd" style="display:block;text-align:center">Empty-Vessel. Pencil sketch</div>
</dl>
<p>Let me introduce to you the another class of so called humans known as &#8211; Attention craving zombies! They belong to an advanced generation of &#8220;Empty Vessels&#8221; species of viruses, which originally known to have originated in relation to solid empty objects mostly metals for making lot of noise, crept into human bodies. This condition is due to an infection, known as &#8220;emptyvesselism&#8221;. This like a disease manifests itself inside the entire human body, but in all cases it resides inside the human head. Hosting itself inside the head logically makes sense, as the skull has the most vessel like structure</p>
<p>As technology has evolved to allow the humans via their brains and hands to communicate over the internet, the virus emptyvesselism has evolved to develop a new digital form, more like a sister-virus. It has to be in contact with its parent being at all times to exhibit active intelligence. But it also shows surprising amount of persistence through autonomous existence in form of noise data when it is out of contact with its parent virus, for example when the host is sleeping or dead. And it hasn&#8217;t stopped with the human brain and mouth, it has taken over the Internet too. Since actual vocal noise takes up lot of bandwidth it takes the form of textual noise data which takes way way less space, makes sense. Looks like a pretty intelligent virus, doesn&#8217;t it?.</p>
<p>[1] This also makes me suspect if the human skull allegedly known to have been made up of bone or more specifically calcium is indeed made up of pure metal, and the brain just another form of emptiness to fill it. This needs further philosophical investigation.</p>
<p>The virus whilst keeping its victim by inducing a trance-like state by making them crave attention like zombies and giving it to them. They loose a sense of the world, reality, and start to embrace it as a part of life, until it becomes their life, a life which seems is only liked by people who are also infected with it. The usual effects of any virus is mostly biological, but emptyvesselism, its psychological (leading to biological), sociological, economical eventually leading to biological side effects. And the technological residue it leaves behind is capable of exiting more viruses to grow in.</p>
<p>Clinical pathology of the virus also reveals that it exhibits a progress structure similar to that  of common viruses, like aids, cancer, etc, but in vastly different fashion and pertains to the psyche of the victim. Its quantified via the factor &#8220;coefficient of emptyvesselism&#8221; or simply zombicity(read: zohhm-bi-ci-ty). Emptyvesselism in its internet form is measured by the term tzombicity (read: zzohhm-bi-ci-ty). The value of the factor as preferred by most humans is a word which a combination of a synonym to word &#8220;psyho&#8221; and from the Oxford dictionary of Profanity.</p>
<p>Even though there are many methods to cure a person of this disease, the most effective way is through Self-Realization, which is known through observation to happen just before the the active-psyche is annihilated by the infected-psyche. This happens only if the active-psyche earlier had &#8211; a self realized purpose, a purpose by defined others, a dream or a goal in life.<br />
The virus can also be neutralized by extreme levels of determination, which in many cases causes agitation amongst other victims and they might try break it. Ones the person has come out of it, they may choose to be entirely disconnected or still stay in contact with the virus yet have no side-effects as they seem to exhibit extreme levels of immunity. But as with any disease, higher the zombicity, more difficult it is to cure.</p>
<p>[2] Presence of this virus is very much apparent in many Internet services, prominent among them  is Twitter, where people just try to chatter in bursts adding only noise but no value in the name of making friends with unknown people. What they don&#8217;t know is that they are retarded, as their so-called-friend is also infected with emptyvesselism.</p>
<p>Another popular place for these zombies to get together is Facebook where one can create, add and share noise amongst the comfortable bounds of (so-called-)friendships, and it can get more rapidly spread here.</p>
<p>Some purists may classify blogging as form of emptyvesselism too, but rehabilitated veterans claim that in many cases it has always been an informative side-effect. But all good-ish-side-effects are not entirely good. There is noise too, in the form of though usually infrequent but an extended burst of words.</p>
<p>Notes:<br />
[1] Logical inference(s) for the insane.<br />
[2] The naked eye observable conclusion(s) for the sane.</p>
<p>(Credit: Pencil sketch version by <i>me</i>, of a <a href='http://bendingmybrainin4d.blogspot.com/2010/04/2-months-of-documentation.html'>painting</a> by <A href='http://alliepush.carbonmade.com/'>allie push</a>)</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/uxUGx6SrxqY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=461</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=461</feedburner:origLink></item>
		<item>
		<title>Fractal Fun and l-systems</title>
		<link>http://feedproxy.google.com/~r/Kalyanchakravarthynet/~3/7YFyFcsXDEs/</link>
		<comments>http://kalyanchakravarthy.net/?p=448#comments</comments>
		<pubDate>Mon, 20 Dec 2010 08:42:26 +0000</pubDate>
		<dc:creator>Kalyan Chakravarthy</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[fractals]]></category>
		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://kalyanchakravarthy.net/?p=448</guid>
		<description><![CDATA[<p>Fractals are fun to understand and also to code. They are also philosophically significant as they offer infinite scope for dissecting an given entity, event in life or for the matter of fact the very human nature, as its never&#8230;</p>]]></description>
				<content:encoded><![CDATA[<p>Fractals are fun to understand and also to code. They are also philosophically significant as they offer infinite scope for dissecting an given entity, event in life or for the matter of fact the very human nature, as its never ending, but thats subjective.</p>
<p>L-Systems are generating self similar fractals, in which an initial set of generating rules cumulatively applied on an initial state for given &#8216;n&#8217; generations produces a growing fractal. The production rules are a variant of formal grammar, very logical and simple to understand and create. Its concisely explained with examples in this <a href="http://en.wikipedia.org/wiki/L-system">wikipedia article on l-systems</a>.</p>
<p>Couple of days back, did an impromptu code sprint and wrote some code for the <a href="code.google.com/p/lsystem-js/">lsystem-js lib project</a> started by <a href="twitter.com/cmdr2">@cmdr2</a>. The Javascript lib can be used to define production or fractal generation rules, handlers for variables and visually draw it on canvas (working on the last part to integrate into the lib itself).</p>
<p>The library is very simple to use, and has helped me to understand few fractal objects as simple as Sierpinski Triangle which for some i have never been able to push into my mind</p>
<p>Here is an lsystem-js lib example to <a href="http://kalyanchakravarthy.net/projects/lsystem/0.2/fractal-plant-demo.html">generate a Fractal Plant</a></p>
<p><a href="http://kalyanchakravarthy.net/tech/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-1.57.14-PM.png"><img class="alignright size-medium wp-image-449" title="Fractal tree - 5th generation" src="http://kalyanchakravarthy.net/tech/wp-content/uploads/2010/12/Screen-shot-2010-12-20-at-1.57.14-PM-300x226.png" alt="" width="300" height="226" /></a></p>
<p><strong>Variables :</strong><br />
X, F</p>
<p><strong>Generation rules :</strong><br />
X → F-[[X]+X]+F[+FX]-X<br />
F → FF</p>
<p><strong>Action</strong><br />
F : Move forward<br />
+: Turn 25° right<br />
- : Turn 25° left<br />
[ : preserve current state<br />
] : retrieve state<br />
X : do nothing</p>
<p><strong>Number of generations</strong><br />
5</p>
<p>
Code fragment to generate the fractal</p>
<div style="clear:both;">&nbsp;</div>
<pre style="display:block;clear:both"><code>// New lSystem - fractal/tree
frac = new lSystem.LSystem ( 'X', {'X' : 'F-[[X]+X]+F[+FX]-X', 'F' : 'FF'} );

// Generate (generation count=5)
frac.generate(5);

// get context
ctx = document.getElementById('canvas').getContext('2d');

/**
 * Fractal RunHandler([init defaults])
 * Run handler lets one define event handlers for variables
 * Here we initialize the variables required by run handler
 */
hfrac = new lSystem.LRunHandler({
	a:40,	// angle
	x:10,	// x
	y:10, 	// y
	r:5,	// radius
	raMap:{},	// radius-angle map/cache
	stack:[]  	// stack for tree
});

/**
 * Specify conditions. State functions
 */
hfrac.on( 'F', function() {
	ctx.beginPath();
	ctx.moveTo( this.x, this.y );
	// cache angle values
	// If the angles are repeated(highly likely),
	// it will reuse existing calculations
	// to preserve the decimal approximation.
	hash = this.r + '#' + this.a;
	if( typeof this.raMap[hash] == 'undefined' ) {
		this.raMap[hash] = {
			x : Math.round( this.r * Math.cos( this.a * Math.PI/180 ) ),
			y : Math.round( this.r * Math.sin( this.a * Math.PI/180 ) )
		};
	}
	this.x += this.raMap[hash].x;
	this.y += this.raMap[hash].y;
	ctx.lineTo( this.x, this.y );
	ctx.stroke();
});
// Turn right 25°
hfrac.on( '+', function() { this.a += 25; });
// turn left 25°
hfrac.on( '-', function() { this.a -= 25; });
// push the state into a stack
hfrac.on( '[', function() { this.stack.push({ x:this.x, y:this.y, a:this.a }); });
// pop the state from the stack
hfrac.on( ']', function() {
	var ls = this.stack.pop();
	this.x = ls.x;
	this.y = ls.y;
	this.a = ls.a;
});
/**
 * frac.run(arg) -&gt; arg is a function(token) or
 *				 -&gt; arg is an LRunHandler() Instance
 */
frac.run(hfrac);
</code></pre>
<p>Simple? More to come</p>
<img src="http://feeds.feedburner.com/~r/Kalyanchakravarthynet/~4/7YFyFcsXDEs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://kalyanchakravarthy.net/?feed=rss2&amp;p=448</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://kalyanchakravarthy.net/?p=448</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.523 seconds -->
