<?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>Thejesh GN &#187; Javascript</title>
	<atom:link href="http://thejeshgn.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://thejeshgn.com</link>
	<description>A Blog, A Website and A container for all my views with excerpts from technology, travel, films, india, photography, kannada, friends and other interests. I am Thejesh GN. Friends call me Thej</description>
	<lastBuildDate>Tue, 22 May 2012 12:28:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Mathematics on Web</title>
		<link>http://thejeshgn.com/2011/06/27/mathematics-on-web/</link>
		<comments>http://thejeshgn.com/2011/06/27/mathematics-on-web/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 14:41:03 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mathematics]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=2663</guid>
		<description><![CDATA[At some point of time course material of Processing will go online. I believe in true web and hence the presentations are in HTML. Last two days I was struggling to put some mathematical formulas with out breaking the web. The best I could find was MathJax. Its an open source JavaScript display engine for [...]]]></description>
			<content:encoded><![CDATA[<p>At some point of time course material of <a href="http://thejeshgn.com/teaching/processing-101/">Processing</a> will go online. I believe in true <a href="http://www.w3.org">web</a> and hence the presentations are in HTML.  Last two days I was struggling to put some mathematical formulas with out breaking the web. The best I could find was <a href="http://www.mathjax.org/">MathJax</a>. Its an open source JavaScript display engine for mathematics that works in all modern browsers. No plugins required and uses @font-face for displaying. Its future proof as I am writing all my formulaes in <a href="http://www.w3.org/1998/Math/MathML">MathML</a>. Its good to know its compatible with screenreaders used by people with vision disabilities.<br />
<span id="more-2663"></span><br />
 Here are some examples. Right click on the formulas to get more details.</p>
<p><strong><a href="http://en.wikipedia.org/wiki/Rogers%E2%80%93Ramanujan_identities">Rogers–Ramanujan identities</a></strong></p>
<pre>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mn>1</mn>
  <mo>+</mo>
  <mfrac>
    <msup>
      <mi>q</mi>
      <mn>2</mn>
    </msup>
    <mrow>
      <mo stretchy="false">(</mo>
      <mn>1</mn>
      <mo>&#x2212;<!-- − --></mo>
      <mi>q</mi>
      <mo stretchy="false">)</mo>
    </mrow>
  </mfrac>
  <mo>+</mo>
  <mfrac>
    <msup>
      <mi>q</mi>
      <mn>6</mn>
    </msup>
    <mrow>
      <mo stretchy="false">(</mo>
      <mn>1</mn>
      <mo>&#x2212;<!-- − --></mo>
      <mi>q</mi>
      <mo stretchy="false">)</mo>
      <mo stretchy="false">(</mo>
      <mn>1</mn>
      <mo>&#x2212;<!-- − --></mo>
      <msup>
        <mi>q</mi>
        <mn>2</mn>
      </msup>
      <mo stretchy="false">)</mo>
    </mrow>
  </mfrac>
  <mo>+</mo>
  <mo>&#x22EF;<!-- ⋯ --></mo>
  <mo>=</mo>
  <mrow>
    <munderover>
      <mo>&#x220F;<!-- ∏ --></mo>
      <mrow>
        <mi>j</mi>
        <mo>=</mo>
        <mn>0</mn>
      </mrow>
      <mrow>
        <mi mathvariant="normal">&#x221E;<!-- ∞ --></mi>
      </mrow>
    </munderover>
  </mrow>
  <mfrac>
    <mn>1</mn>
    <mrow>
      <mo stretchy="false">(</mo>
      <mn>1</mn>
      <mo>&#x2212;<!-- − --></mo>
      <msup>
        <mi>q</mi>
        <mrow>
          <mn>5</mn>
          <mi>j</mi>
          <mo>+</mo>
          <mn>2</mn>
        </mrow>
      </msup>
      <mo stretchy="false">)</mo>
      <mo stretchy="false">(</mo>
      <mn>1</mn>
      <mo>&#x2212;<!-- − --></mo>
      <msup>
        <mi>q</mi>
        <mrow>
          <mn>5</mn>
          <mi>j</mi>
          <mo>+</mo>
          <mn>3</mn>
        </mrow>
      </msup>
      <mo stretchy="false">)</mo>
    </mrow>
  </mfrac>
  <mo>,</mo>
  <mspace width="1em" />
  <mtext>for&#xA0;</mtext>
  <mrow>
    <mrow>
      <mo>|</mo>
    </mrow>
    <mi>q</mi>
    <mrow>
      <mo>|</mo>
    </mrow>
    <mo>&lt;</mo>
    <mn>1</mn>
  </mrow>
  <mo>.</mo>
</math>
</pre>
<p><strong><a href="http://en.wikipedia.org/wiki/Maxwell's_equations">Maxwell’s Equations</a></strong></p>
<pre>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtable columnalign="right left right left right left right left right left right left" rowspacing=".5em" columnspacing="0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em">
    <mtr>
      <mtd>
        <mi mathvariant="normal">&#x2207;<!-- ∇ --></mi>
        <mo>&#x00D7;<!-- × --></mo>
        <mover>
          <mrow>
            <mi mathvariant="bold">B</mi>
          </mrow>
          <mo>&#x20D7;<!-- ⃗ --></mo>
        </mover>
        <mo>&#x2212;<!-- − --></mo>
        <mspace width="thinmathspace" />
        <mfrac>
          <mn>1</mn>
          <mi>c</mi>
        </mfrac>
        <mspace width="thinmathspace" />
        <mfrac>
          <mrow>
            <mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
            <mover>
              <mrow>
                <mi mathvariant="bold">E</mi>
              </mrow>
              <mo>&#x20D7;<!-- ⃗ --></mo>
            </mover>
          </mrow>
          <mrow>
            <mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
            <mi>t</mi>
          </mrow>
        </mfrac>
      </mtd>
      <mtd>
        <mo>=</mo>
        <mfrac>
          <mrow>
            <mn>4</mn>
            <mi>&#x03C0;<!-- π --></mi>
          </mrow>
          <mi>c</mi>
        </mfrac>
        <mover>
          <mrow>
            <mi mathvariant="bold">j</mi>
          </mrow>
          <mo>&#x20D7;<!-- ⃗ --></mo>
        </mover>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
        <mi mathvariant="normal">&#x2207;<!-- ∇ --></mi>
        <mo>&#x22C5;<!-- ⋅ --></mo>
        <mover>
          <mrow>
            <mi mathvariant="bold">E</mi>
          </mrow>
          <mo>&#x20D7;<!-- ⃗ --></mo>
        </mover>
      </mtd>
      <mtd>
        <mo>=</mo>
        <mn>4</mn>
        <mi>&#x03C0;<!-- π --></mi>
        <mi>&#x03C1;<!-- ρ --></mi>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
        <mi mathvariant="normal">&#x2207;<!-- ∇ --></mi>
        <mo>&#x00D7;<!-- × --></mo>
        <mover>
          <mrow>
            <mi mathvariant="bold">E</mi>
          </mrow>
          <mo>&#x20D7;<!-- ⃗ --></mo>
        </mover>
        <mspace width="thinmathspace" />
        <mo>+</mo>
        <mspace width="thinmathspace" />
        <mfrac>
          <mn>1</mn>
          <mi>c</mi>
        </mfrac>
        <mspace width="thinmathspace" />
        <mfrac>
          <mrow>
            <mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
            <mover>
              <mrow>
                <mi mathvariant="bold">B</mi>
              </mrow>
              <mo>&#x20D7;<!-- ⃗ --></mo>
            </mover>
          </mrow>
          <mrow>
            <mi mathvariant="normal">&#x2202;<!-- ∂ --></mi>
            <mi>t</mi>
          </mrow>
        </mfrac>
      </mtd>
      <mtd>
        <mo>=</mo>
        <mover>
          <mrow>
            <mn mathvariant="bold">0</mn>
          </mrow>
          <mo>&#x20D7;<!-- ⃗ --></mo>
        </mover>
      </mtd>
    </mtr>
    <mtr>
      <mtd>
        <mi mathvariant="normal">&#x2207;<!-- ∇ --></mi>
        <mo>&#x22C5;<!-- ⋅ --></mo>
        <mover>
          <mrow>
            <mi mathvariant="bold">B</mi>
          </mrow>
          <mo>&#x20D7;<!-- ⃗ --></mo>
        </mover>
      </mtd>
      <mtd>
        <mo>=</mo>
        <mn>0</mn>
      </mtd>
    </mtr>
  </mtable>
</math>
</pre>
<p>All I had to do was <a href="http://www.mathjax.org/docs/1.1/platforms/index.html">insert a javascript</a> in my wordpress header file. But I am already loading too many javascript files in my header, So I added a custom field in my wordpress called &#8220;math&#8221;. If its set to yes then it loads this MathJax otherwise it wont. Also I had to put the MathML code inside a pre tag to keep it clean. </p>
<p>Can you see it? if not what browser and OS are you using? </p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2011/06/27/mathematics-on-web/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Game of Life with Processing.js</title>
		<link>http://thejeshgn.com/2011/05/06/game-of-life-with-processing-js/</link>
		<comments>http://thejeshgn.com/2011/05/06/game-of-life-with-processing-js/#comments</comments>
		<pubDate>Thu, 05 May 2011 20:00:25 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[hackers]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[processingjs]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=2507</guid>
		<description><![CDATA[I was bored. So I thought of playing Game of Life. I got to know about it through hacker logo which is the glider pattern from the Game of Life. While playing I thought let me code it processing.js. Game of life is a simple game with no interaction involved once you start with the [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.catb.org/hacker-emblem/'><img class="imgleft" src='http://www.catb.org/hacker-emblem/glider.png' alt='hacker emblem' /></a> I was <a href="http://thej.in/?p=16099">bored</a>. So I thought of playing <a href="http://en.wikipedia.org/wiki/Conway's_Game_of_Life">Game of Life</a>. I got to know about it through <a href="http://www.catb.org/hacker-emblem/">hacker</a> logo which is the glider pattern from the Game of Life. While playing I thought let me code it processing.js. Game of life is a simple game with no interaction involved once you start with the initial seed.<br />
From Wikipedia:<br />
The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.[1]<br />
The &#8220;game&#8221; is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.</p>
<p>The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:</p>
<ol>
<li>Any live cell with fewer than two live neighbours dies, as if caused by under-population.</li>
<li>Any live cell with two or three live neighbours lives on to the next generation.</li>
<li>Any live cell with more than three live neighbours dies, as if by overcrowding.</li>
<li>Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.</li>
</ol>
<p>The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed—births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a pure function of the preceding one). The rules continue to be applied repeatedly to create further generations.</p>
<p>The initial code was borrowed from <a href="http://ephexi.com/noc/gameoflife2/">Ran Tao&#8217;s java based program</a>. I rewrote in <a href="http://processingjs.org/">Javascript version of Processing</a>. Also added player buttons for more control.  Also added a way to start with your own seed through it starts with random seed.  One more change to the original Life is that you can introduce a living cell while its playing. Just click on the grid. Its kind of against the actual game, but it seemed more fun to me. </p>
<p><iframe src="http://media.thejeshgn.com/script/processingjs/gof-embed.html" width="540" height="500" border="0" SCROLLING=no></iframe></p>
<p>Clear it and introduce your own seed using mouse or just intrude, you are God. <a href="http://media.thejeshgn.com/script/processingjs/gof.html">Go to full page version its more fun.</a> Source code is on <a href="https://gist.github.com/958736">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2011/05/06/game-of-life-with-processing-js/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Javascript API for wordpress posts</title>
		<link>http://thejeshgn.com/2011/04/11/javascript-api-for-wordpress-posts/</link>
		<comments>http://thejeshgn.com/2011/04/11/javascript-api-for-wordpress-posts/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 10:24:53 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[wordress]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=2409</guid>
		<description><![CDATA[I have been looking at ways of using my activity stream. The stream is a WordPress blog and has various kinds of data (status msg, pictures, links and posts). Eventhough wordpress provides certain xml based APIs, I wanted something simple, that works on client side. One of the requirement was to pull the latest mobile [...]]]></description>
			<content:encoded><![CDATA[<p>I have been looking at ways of using my <a href="http://thej.in">activity stream</a>. The stream is a WordPress blog and has various kinds of data (status msg, pictures, links and posts). Eventhough wordpress provides certain xml based APIs, I wanted something simple, that works on client side.</p>
<p>One of the requirement was to pull the latest mobile picture post, to display on my main blog. By default wordpress provides RSS feed for each author, category and tag. It wasnt that difficult to get the latest post but it is difficult to use XML in JavaScript. JSON seemed more useful than RSS. In the mean time Dave Winer was also <a href="http://scripting.com/stories/2011/03/17/jsonifiedRss.html">thinking on similar lines</a>. I thought about writing a plugin to convert RSS feed into JSON feed. But then whole wordpress family seems to like Dave (Remember WP.com supports RSS cloud). So I searched wordpress plugins. I found the one which I wanted &#8211; <a href="http://wordpress.org/extend/plugins/feed-json/">Feed JSON</a> . <span id="more-2409"></span><br />
So it gives me JSON feed for my mobile picture stream and also has call back feature. </p>
<pre class="brush: plain; title: ; notranslate">

http://thej.in/?feed=json&#038;author=4

//with callback

http://thej.in/?feed=json&#038;callback=mymethod

&amp;author=4
</pre>
<p>It also works with permalinks if that is enabled in wordpress. Here comes my widget for latest camera pics.</p>
<pre class="brush: plain; title: ; notranslate">
&lt;script&gt;
function writeWidget(posts){
alert(posts[0][&quot;title&quot;]);
}
&lt;/script&gt;
&lt;script src=&quot;http://thej.in/?feed=json&amp;author=4&amp;
callback=writeWidget&quot;&gt;
&lt;/script&gt;
</pre>
<p>Now with this its easy for any wordpress blog to create JavaScript based widgets, that can be embedded any where on the web. Well for some use cases the full content JSON could be heavy. So try it before you widely deploy. Let me know what you think. </p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2011/04/11/javascript-api-for-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting started with Processingjs by writing Analog clock</title>
		<link>http://thejeshgn.com/2009/10/29/getting-started-with-processingjs-by-writing-analog-clock/</link>
		<comments>http://thejeshgn.com/2009/10/29/getting-started-with-processingjs-by-writing-analog-clock/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 10:50:54 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[processingjs]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=1429</guid>
		<description><![CDATA[As most of you know, I love JavaScript.  Recently I started exploring Processing.js to create some dynamic graphs and animation. I was bowled over by the power of Processing.js. &#8220;Processing.js is an open programming language for people who want to program images, animation, and interactions for the web without using Flash or Java applets. Processing.js [...]]]></description>
			<content:encoded><![CDATA[<p>As most of you know, I love JavaScript.  Recently I started exploring <a href="http://processingjs.org/">Processing.js</a> to create some dynamic graphs and animation. I was bowled over by the power of Processing.js.</p>
<p>&#8220;Processing.js is an open programming language for people who want to program images, animation, and interactions for the web without using Flash or Java applets. Processing.js uses JavaScript to draw shapes and manipulate images on the HTML5 Canvas element. The code is light-weight, simple to learn and makes an ideal tool for visualizing data, creating user-interfaces and developing web-based games.&#8221;</p>
<p>The Processing language was originally created by Ben Fry and Casey Reas for Java. In 2008, John Resig ported the 2D context of Processing to JavaScript. It needs Canvas. So make sure you are using HTML5 capable browser like Firefox <sup><a  name="fn1-topnote" href="#fn1-footnote">1</a></sup>.</p>
<p><strong>Setup:</strong> Download the <a href="http://processingjs.org/download">processing.js</a>. That is the only file you need.</p>
<p><strong>Initialize processing:</strong> We need to initialize the processing engine on a canvas. We will have that in the init.js and will include that.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;html&gt;
&lt;head&gt;
&lt;script src=&quot;init.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;processing.min.js&quot;&gt;&lt;/script&gt;
&lt;title&gt;Analog Clock using Processing.js&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type=&quot;application/processing&quot; target=&quot;clock&quot;&gt;
//your processing code
&lt;/script&gt;&lt;canvas id=&quot;clock&quot;&gt;You need HTML5 canvas support.
Try latest Firefox&lt;/canvas&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The above code snippet shows the basic setup to run. We need to add our processing code inside</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;application/processing&quot;&gt;
//your processing code
&lt;/script&gt;
</pre>
<p>The init.js code actually searches for all the script tag type=&#8221;application/processing&#8221; and applies processing the code on the target canvas. <a href="http://media.thejeshgn.com/script/processingjs/init.js">init.js</a> was borrowed from <a href="http://ejohn.org/">JResig</a>&#8216;s code examples.</p>
<p><strong>Logic for the clock:</strong><br />
<a class="wikipedia" href="http://en.wikipedia.org/wiki/Circle">Circle</a> has 2PI radians. So for each second/minute we have to move 2PI/60 radians. Given the center of the circle (a,b), radius r and angle t radians. we can find any point on the circle, using<br />
x = a+r cos(t);<br />
y = b+r sin(t);<br />
or<br />
x = a + r (1-t<sup>2</sup>)/(1+t<sup>2</sup>)<br />
y = b + r (2t)/(1+t<sup>2</sup>)</p>
<p>I have used the first set of formula.  Processing.js supports time and trigonometric functions by default.</p>
<p>But the 0 degrees start at horizontally and I wanted 0<sup>th</sup> hour to start at 90 degrees. And hence the subtraction of quarterCicrle which equals = PI/2.</p>
<p>The two main important methods are<br />
void setup() &#8211; called initially when canvas gets loaded.<br />
void draw() &#8211; called at the rate of frameRate.<br />
<span id="more-1429"></span><br />
You can see I have set frame rate to 1 sec. I guess the rest of the code is self explanatory.</p>
<pre class="brush: jscript; title: ; notranslate">
int radius=90;
int a=100;
int b=100;
int nx,ny;

void setup(){
  size(200,200);
  strokeWeight(5);
  //run every second
  frameRate(1);
}
void draw(){

	r = radius;
	background(100);
	ellipse(a,b,2*radius, 2*radius);
	int quarterCicrle=PI/2;

	//second
	int t=((2*PI/60)*second())-quarterCicrle;
	nx = a+r*cos(t);
	ny = b+r*sin(t);
	strokeWeight(2);
	stroke(100);
	line(a,b,nx,ny);

	//minute
	t=((2*PI/60)*minute())-quarterCicrle;
	nx = a+r*cos(t);
	ny = b+r*sin(t);
	strokeWeight(5);
	stroke(100);
	line(a,b,nx,ny);

	//hour
	t=((2*PI/12)*hour())-quarterCicrle;
	nx = a+r*cos(t);
	ny = b+r*sin(t);
	strokeWeight(8);
	stroke(100);
	line(a,b,nx,ny);

}
</pre>
<p><iframe src="http://media.thejeshgn.com/script/processingjs/analog.htm" style="border: 0pt none ;" height="220" scrolling="no" width="220"></iframe><br />
<small><a href="http://media.thejeshgn.com/script/processingjs/analog.htm" target="_new">launch in a separate page</a></small><br />
With processingjs graphics in JavaScript has become very easy. This is just an example and processing.js can do much more complex things, Their website has lots of good example. <a href="http://processingjs.org/exhibition">Go explore</a>.</p>
<p><strong>Foot Notes:</strong><br />
1. Browsers like <a href="http://www.mozilla.com/en-US/firefox/all-beta.html">Firefox 3.0 Beta 5</a>, <a href="http://nightly.webkit.org/">WebKit </a> and <a href="http://www.opera.com/products/desktop/next/">Opera 9.5</a> have canvas support.<a name="fn1-footnote" href="#fn1-topnote" title="Jump back to footnote 1 in the post">↩</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2009/10/29/getting-started-with-processingjs-by-writing-analog-clock/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to kill that Digg Bar Frame</title>
		<link>http://thejeshgn.com/2009/04/04/how-to-kill-that-digg-bar-frame/</link>
		<comments>http://thejeshgn.com/2009/04/04/how-to-kill-that-digg-bar-frame/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 11:58:13 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=771</guid>
		<description><![CDATA[Digg recently introduced url shortener. This is not your standard url shortener where the shortener does a 302 forward. Digg shortener displays destination site in a frame. Which means the reader still stays on the Digg. Most of the modern web analytics software will be able to record this visit, but it will problem in [...]]]></description>
			<content:encoded><![CDATA[<p>Digg recently introduced <a href="http://www.techcrunch.com/2009/04/02/diggs-toolbar-is-here-go-shorten-those-urls/">url shortener</a>. This is not your standard url shortener where the shortener does a 302 forward. Digg shortener displays destination site in a frame. Which means the reader still stays on the Digg.<br />
<img src="http://media.thejeshgn.com/img/blogging/digg-shortner.GIF" alt="" width="500" /><br />
Most of the modern web analytics software will be able to record this visit, but it will problem in finding out the actual referrer.  Also standard traffic <a href="http://www.techcrunch.com/2009/04/02/diggbar-keeps-all-digg-homepage-traffic-on-digg/">counters like alexa</a> don&#8217;t count this visit against your site.<br />
So if you don&#8217;t like to that DiggBar to be displayed on your blog.  You can add this one line code to your site.  Add it to your webpage&#8217;s head section.</p>
<pre class="brush: xml; light: true; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
if (top !== self) top.location.href = self.location.href;
&lt;/script&gt;
</pre>
<p>This code in fact doesn&#8217;t allow anybody to display your content in their frame. Here is the demo url <a href="http://digg.com/u1BSW">http://digg.com/u1BSW</a> to check. It should work on all browsers.<br />
Let me know if you have any other suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2009/04/04/how-to-kill-that-digg-bar-frame/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scriptlet for Easy Commenting on WordPress Blogs</title>
		<link>http://thejeshgn.com/2009/01/20/scriptlet-for-easy-commenting-on-wordpress-blogs/</link>
		<comments>http://thejeshgn.com/2009/01/20/scriptlet-for-easy-commenting-on-wordpress-blogs/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 07:48:58 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[scriptlet]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=512</guid>
		<description><![CDATA[I like to comment when I read a good post. More than 50% of the blogs that I read are on either wordpress.com or hosted . So I created a simple scriptlet to fill the comment form for ease of commenting.Then I thought it could be useful to others too. So I wrote this small [...]]]></description>
			<content:encoded><![CDATA[<p>I like to comment when I read a good post. More than 50% of the blogs that I read  are on either wordpress.com or hosted . So I created a simple scriptlet to fill the comment form for ease of commenting.Then I thought it could be useful to others too. So I wrote this small script to create a scriptlet for you.<br />
Fill up the name, email and url you use while commenting. You can even have some default comment if you want. Make sure not to use single or double quotes. As of now the JS code breaks. Try to manage with out quotes : )<br />
Once you have entered the details click &#8220;Generate Scriptlet&#8221;. If everything goes OK then the link below the button becomes &#8220;Fill Comment&#8221;. Pull it to your links bar. Now that should make your commenting easy on any wordpress blog. Send in your comments.<br />
<script>
function create(){
author = document.getElementById("myauthor").value;
email = document.getElementById("myemail").value;
url = document.getElementById("myurl").value;
comment = document.getElementById("mycomment").value;
scriptlet = 'javascript:function fill(){document.getElementById("author").value="'+author+'";document.getElementById("email").value="'+email+'";document.getElementById("url").value="'+url+'";document.getElementById("comment").value="'+comment+'"}fill();'
document.getElementById("completedScriptlet").href=scriptlet;
document.getElementById("completedScriptlet").innerHTML= "Fill Comment";
}
</script></p>
<p>Your Name:<br />
<input name="myauthor" id="myauthor" value="" size="22" tabindex="1" type="text"/>
<p>Your Email:<br />
<input name="myemail" id="myemail" value="" size="22" tabindex="2" type="text"/>
<p>Your URL:<br />
<input maxlength="100" name="myurl" id="myurl" value="" size="22" tabindex="3" type="text"/>
<p>Default Comment or leave blank:<br />
<input maxlength="100" name="mycomment" id="mycomment" value="" size="42" tabindex="4" type="text"/>
<input type=button value="create scriptlet" onclick="create()" />
<p><a id="completedScriptlet" href="">Not yet</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2009/01/20/scriptlet-for-easy-commenting-on-wordpress-blogs/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>My code contribution during foss.in/2008 jFotoNotes</title>
		<link>http://thejeshgn.com/2008/11/26/my-code-contribution-during-fossin2008-jfotonotes/</link>
		<comments>http://thejeshgn.com/2008/11/26/my-code-contribution-during-fossin2008-jfotonotes/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 12:00:40 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=495</guid>
		<description><![CDATA[I am attending FOSS.IN/2008 virtually through twitter (unfortunately I could not attend due to work pressure). Here is my contribution to the FOSS world as part of FOSS.IN/2008. Go to jFotoNotes project page jFotoNotes is java implementation of famous FotoNotes in php. A variation of FotoNotes is also used by flickr. Fotonotes is a standard, [...]]]></description>
			<content:encoded><![CDATA[<p>I am attending <a href="http://foss.in">FOSS.IN/2008</a> virtually through twitter (unfortunately I could not attend due to work pressure).  Here is my contribution to the FOSS world as part of FOSS.IN/2008.</p>
<h3 style="text-align: center;"><a href="http://thejeshgn.com/tools/jfotonotes/">Go to jFotoNotes project page<br />
</a></h3>
<p><a href="http://thejeshgn.com/tools/jfotonotes/">jFotoNotes</a> is java implementation of famous <a href="http://www.fotonotes.net/">FotoNotes</a> in php. A variation of FotoNotes is also used by flickr. Fotonotes is a standard, specification, and collection of scripts for annotating images.  In jFotoNotes I have used the same JavaScript libraries but I have completely rewritten the server side components in Java.<br />
<img src="http://share.thejeshgn.com/jFotoNotes/jFotoNotes.jpg" alt="jFotoNotes" width="375" /></p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2008/11/26/my-code-contribution-during-fossin2008-jfotonotes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What does &#8220;Google Chrome&#8221;  mean to developers</title>
		<link>http://thejeshgn.com/2008/09/02/what-does-google-chrome-mean-developers/</link>
		<comments>http://thejeshgn.com/2008/09/02/what-does-google-chrome-mean-developers/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 06:01:22 +0000</pubDate>
		<dc:creator>Thejesh GN</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://thejeshgn.com/?p=450</guid>
		<description><![CDATA[Yet another browser to code for? I guess it will obey ECMA-262 rev3 so don&#8217;t worry too much about incompatibilities as of now. Lets see the positive side Its an open source, you get to participate and allows you to write plug-ins Each tab is a separate process.so the effect of one tab is not [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another browser to code for? I guess it will obey ECMA-262 rev3 so don&#8217;t worry too much about incompatibilities as of now. Lets see the positive side</p>
<p><img src="http://media.thejeshgn.com/img/blogging/chrome_developer.png" alt="" width="486" height="288" /></p>
<ol>
<li> Its an open source, you get to participate and allows you to write plug-ins</li>
<li>Each tab is a separate process.so the effect of one tab is not seen in another tab.</li>
<li>Within each tab you have separate thread for JavaScript. So your JavaScript execution will be fast.</li>
<li>JavaScript now runs inside a virtual machine called V8. The JavaScript is compiled to machine code before running. Now that&#8217;s an advantage for heavy JavaScript applications like Gmail. Where most of the JS resides on client side and simply gets the JSON from server to show the data. You don&#8217;t have to re-interpret the JS every time. Compile once and keep running again and again. Your apps will be super fast now. Now GWT developers don&#8217;t have worry about JS performance.</li>
<li>Rendering is by webkit which is again open source.</li>
<li>Looks like they have better garbage collection algorithm for garbage collection. Which will again makes my work simple.</li>
<li>Gears is part of browser now. Your offline apps will have better performance now. Think -&gt; Gears API is loaded as soon as browser is loaded, JavaScript is compiled to m/c code, runs in separate process and thread. What more you want?  Your offline application might be as fast as any native application if not faster.</li>
</ol>
<p>Anything else you want to add.</p>
]]></content:encoded>
			<wfw:commentRss>http://thejeshgn.com/2008/09/02/what-does-google-chrome-mean-developers/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

