<?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>Theta Script</title>
	<atom:link href="http://thetascript.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thetascript.com</link>
	<description>Javascript, HTML, CSS and more    Curated by Vetrichelvan. J</description>
	<lastBuildDate>Thu, 16 May 2013 13:39:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Underscore.js 101 &#8211; _.filter and _.contains</title>
		<link>http://thetascript.com/underscore-js-functions-101-_-filter-and-_-contains/</link>
		<comments>http://thetascript.com/underscore-js-functions-101-_-filter-and-_-contains/#comments</comments>
		<pubDate>Thu, 16 May 2013 13:33:11 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[underscore.js]]></category>

		<guid isPermaLink="false">http://thetascript.com/?p=218</guid>
		<description><![CDATA[<p>Underscore.js one of the powerful utility JS libraries out there. In this post am goin to explain some of the functions and how they can be mixed and matched to get our required functionality. _.filter: _.filter it looks through the list we pass and returns all the values that are truthy as per the iterator. ...</p><p>The post <a href="http://thetascript.com/underscore-js-functions-101-_-filter-and-_-contains/">Underscore.js 101 &#8211; _.filter and _.contains</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://underscorejs.org/">Underscore.js</a> one of the powerful utility JS libraries out there. In this post am goin to explain some of the functions and how they can be mixed and matched to get our required functionality.</p>
<h4>_.filter:</h4>
<p><strong><code>_.filter</code></strong> it looks through the list we pass and returns all the values that are truthy as per the iterator.</p>
<p><code>var odds = _.filter([1,2,3,4,5,6], function(num){ return num % 2 !== 0})<br />
// [1, 3, 5]</code></p>
<p>returns all the odd number on the list.</p>
<p>Lets take an example you have a list of strings.</p>
<p><code>var langs = ['Ruby', 'RoR', 'Python', 'Django', 'Java', 'Javascript', 'Node.js'];</code></p>
<p>You want to extract the items based on the starting letter in a word</p>
<p><code>_.filter(arr, function(i){var startLetter = i.slice(); return startLetter[0] === 'R'}) // ["Ruby", "RoR"]</code></p>
<p>for searching between more than one letter you may have to do something like this</p>
<p><code>_.filter(arr, function(i){var startLetter = i.slice(); return startLetter[0] === 'R' || startLetter[0] === 'P'}) // ["Ruby", "RoR", "Python"]</code></p>
<p>It will become more complex if we are goin to add more letters to support in this, we can minimize the complexity with one more function Underscore provides us.</p>
<h4>_.contains:</h4>
<p><strong><code>_.contains</code></strong> returns true if the passed value is present in array.</p>
<p><code>_.contains([1, 2, 3], 3); // true</code></p>
<p>this can be used in our existing filter function to reduce the long list of OR conditions </p>
<p><code>_.filter(arr, function(i){var startLetter = i.slice(); return _.contains(['R', 'P'],startLetter[0])}) // ["Ruby", "RoR", "Python"]</code></p>
<p>this is easy to maintain and scalable.</p>
<p>The post <a href="http://thetascript.com/underscore-js-functions-101-_-filter-and-_-contains/">Underscore.js 101 &#8211; _.filter and _.contains</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/underscore-js-functions-101-_-filter-and-_-contains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Compression and CSS Sprites &#8211; Web Developer Tools</title>
		<link>http://thetascript.com/image-compression-and-css-sprites-web-developers-utility-belt/</link>
		<comments>http://thetascript.com/image-compression-and-css-sprites-web-developers-utility-belt/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 19:00:09 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS sprites]]></category>
		<category><![CDATA[Image Compression]]></category>

		<guid isPermaLink="false">http://thetascript.com/?p=138</guid>
		<description><![CDATA[<p>So here are some of the links. I found useful while developing, for image compression and in making sprites SpritePad SpritePad is the best tool I have seen so far to create CSS Sprites. You can simply drag and drop the images and download the sprite. Fit document is a nice feature. Also it gives ...</p><p>The post <a href="http://thetascript.com/image-compression-and-css-sprites-web-developers-utility-belt/">Image Compression and CSS Sprites &#8211; Web Developer Tools</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>So here are some of the links. I found useful while developing, for image compression and in making sprites</p>
<h3><a href="http://spritepad.wearekiss.com/">SpritePad</a></h3>
<p><!--a href="http://spritepad.wearekiss.com/"><img style="width: 600px; height: 219px;" src="/wordpress/wp-content/uploads/2012/10/spritePad.png" alt="SpritePad" /></a--><br />
SpritePad is the best tool I have seen so far to create CSS Sprites. You can simply drag and drop the images and download the sprite. Fit document is a nice feature. Also it gives the style accordingly for individual pngs with their name as classname.</p>
<h3><a href="http://www.spritecow.com/">Sprite Cow</a></h3>
<p><!--a href="http://www.spritecow.com/"><img style="width: 600px; height: 219px;" src="/wordpress/wp-content/uploads/2012/10/spriteCow.png" alt="SpritePad" /></a--><br />
Using sprites needs some experience as it is hard to find the perfect CSS position. SpriteCow helps in it. Open an image in this web app and point your mouse to the image on the sprite to get the exact CSS position and code. If you already have a sprite this is what you should be using for gettin positions.</p>
<h3><a href="http://tinypng.org/">TinyPNG</a></h3>
<p><!--a href="http://tinypng.org/"><img style="width: 600px; height: 277px;" src="/wordpress/wp-content/uploads/2012/10/tinyPNG.png" alt="SpritePad" /></a--><br />
In cases were you can&#8217;t use sprites, and have to use individual pngs. The best thing you can do is reduce the size of the png so that you can improve performance of your site. TinyPNG is the best i have seen so far in doin that. I have seen a good amount of reduction in size. I highly suggest you use this in your project, you can reduce the size of the sprite as well in this, to get better results.</p>
<h3><a href="http://www.jpegmini.com/main/shrink_photo?test_cookie=1">JPEGmini</a></h3>
<p><!--a href="http://www.jpegmini.com/main/shrink_photo?test_cookie=1"><img style="width: 350px; height: 219px;" src="/wordpress/wp-content/uploads/2012/10/jpegMini.png" alt="SpritePad" /></a--></p>
<p>It does the same thing as TinyPNG, but for JPEG files. I like the way they show the original and the minimized version.</p>
<h3><a href="http://cropp.me/">cropp.me</a></h3>
<p>Easier way to crop your image files.</p>
<p>The post <a href="http://thetascript.com/image-compression-and-css-sprites-web-developers-utility-belt/">Image Compression and CSS Sprites &#8211; Web Developer Tools</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/image-compression-and-css-sprites-web-developers-utility-belt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conversions in Javascript</title>
		<link>http://thetascript.com/conversions-in-javascript/</link>
		<comments>http://thetascript.com/conversions-in-javascript/#comments</comments>
		<pubDate>Sun, 16 Sep 2012 14:30:16 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://thetascript.com/?p=115</guid>
		<description><![CDATA[<p>Using Javascript has an ease, you can achieve the same result by doing it in different ways. Here am going to discuss about the performance implications of the same. Lets start with string to number conversion. The usual way of string to number conversion is done using parseInt. However there are someother ways it can ...</p><p>The post <a href="http://thetascript.com/conversions-in-javascript/">Conversions in Javascript</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>Using Javascript has an ease, you can achieve the same result by doing it in different ways. Here am going to discuss about the performance implications of the same. Lets start with string to number conversion. The usual way of string to number conversion is done using parseInt. However there are someother ways it can be done as well</p>
<pre>
var n1 = parseInt("12");
var n2 = Number("12");
var n3 = +"12";
var n4 = ~~(1*"12");
</pre>
<p>All of the above does the same job and <code>n1==n2==n3==n4</code>. So, of all the ways we have to see which one is the ideal way to do that. This is where performance is a big consideration. In this <a href="http://jsperf.com/parsenumber/2" title="parseNumber">jsperf test</a> we can see which one performs well. Of four of them the last wicked way performs well in all browsers except chrome and safari webkit browsers(I don&#8217;t know why). At the end the best way is to use the parseInt, somebody might prefer using +&#8221;Value&#8221; for ease of typing. However should know the performance benefits of the other ways. Similarly, string conversion</p>
<pre>
var date = new Date();
var ds = date.toString();
var dr = date+"";
</pre>
<p>In this case <code>ds==dr</code>, the way toString works is faster in <a href="http://jsperf.com/stringconversion" title="String Conversion">most cases</a>.</p>
<p>The post <a href="http://thetascript.com/conversions-in-javascript/">Conversions in Javascript</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/conversions-in-javascript/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Brain Effing Javascript</title>
		<link>http://thetascript.com/brain-effing-javascript/</link>
		<comments>http://thetascript.com/brain-effing-javascript/#comments</comments>
		<pubDate>Tue, 21 Aug 2012 17:46:27 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://thetascript.com/?p=69</guid>
		<description><![CDATA[<p>Javascript has always been fascinating to me in so many ways, because it packs in so many things for a language that has been developed in 2 weeks (there were improvements after that). Look at this JavaScript var truthy = true; if(truthy === !+[]){ console.log("It's Truthy"); } Put this in the console and it prints ...</p><p>The post <a href="http://thetascript.com/brain-effing-javascript/">Brain Effing Javascript</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>Javascript has always been fascinating to me in so many ways, because it packs in so many things for a language that has been developed in 2 weeks (there were improvements after that). Look at this</p>
<p><strong>JavaScript</strong></p>
<pre>  var truthy = true;
  if(truthy === !+[]){
    console.log("It's Truthy");
  }</pre>
<p>Put this in the console and it prints the value. It&#8217;s &#8217;cause</p>
<pre>!+[] === true</pre>
<p>javascript interprets the combination of these special characters into actual values. Similary</p>
<pre>!!+[] === false</pre>
<p>And also you can get numbers like this</p>
<pre>+[] === 0
+!+[] === 1
!+[]+!+[] === 2
....</pre>
<p>We can create all the numbers by adding !+[] like that. Using this, if you want your fellow programmer to go mad you can do something like this</p>
<p><strong>JavaScript</strong></p>
<pre> 
var l = +!+[];
for (var i = +[]; i &lt;= !+[] + !+[]; i++) {
    l = l + (+!+[]);
    console.log(l);
}</pre>
<p>with these special character combinations, a complete program can be written in javascript.</p>
<p>Further reading:</p>
<p><a title="Non-alphanumeric-javascript" href="http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html" target="_blank">http://patriciopalladino.com/blog/2012/08/09/non-alphanumeric-javascript.html</a></p>
<p>The post <a href="http://thetascript.com/brain-effing-javascript/">Brain Effing Javascript</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/brain-effing-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery AnimationEnd Plugin &#8211; Provides a callback when a CSS3 animation is complete on an element</title>
		<link>http://thetascript.com/jquery-animationend-plugin-provides-a-callback-when-a-css3-animation-is-complete-on-an-element/</link>
		<comments>http://thetascript.com/jquery-animationend-plugin-provides-a-callback-when-a-css3-animation-is-complete-on-an-element/#comments</comments>
		<pubDate>Thu, 09 Aug 2012 10:52:47 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS3]]></category>

		<guid isPermaLink="false">http://thetascript.com/?p=51</guid>
		<description><![CDATA[<p>There will be some instances where in we have to do something after a CSS3 animation is complete on a particular element. This plugin will come in handy on those cases. Plugin attaches to the animationEnd and transitionEnd events, fired when an animation is complete and provides a callback. Javascript $.fn.animationEnd = function(callback) { return ...</p><p>The post <a href="http://thetascript.com/jquery-animationend-plugin-provides-a-callback-when-a-css3-animation-is-complete-on-an-element/">jQuery AnimationEnd Plugin &#8211; Provides a callback when a CSS3 animation is complete on an element</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>There will be some instances where in we have to do something after a CSS3 animation is complete on a particular element. This plugin will come in handy on those cases.</p>
<p>Plugin attaches to the animationEnd and transitionEnd events, fired when an animation is complete and provides a callback.</p>
<p><strong>Javascript</strong></p>
<pre>
$.fn.animationEnd = function(callback) {
        return this.each(function(){
          var $this = $(this);
              $this.bind("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd transitionend webkitTransitionEAnind oTransitionEnd MSTransitionEnd", function() {
                if (typeof callback == 'function') {
                    callback.call(this); // brings the scope to the callback
                };
            });
        })
        
    };
</pre>
<p>In the demo, I have a case where we want to remove the class which provides the css3 styles, at the animation end so that we can add the class again to trigger the animation.</p>
<p><a class="demoButton" href="http://jsfiddle.net/vetri02/EE3zs/10/">Demo</a></p>
<p>Suggestions are welcome to improve this plugin.Please, point out mistakes as well.</p>
<p>The post <a href="http://thetascript.com/jquery-animationend-plugin-provides-a-callback-when-a-css3-animation-is-complete-on-an-element/">jQuery AnimationEnd Plugin &#8211; Provides a callback when a CSS3 animation is complete on an element</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/jquery-animationend-plugin-provides-a-callback-when-a-css3-animation-is-complete-on-an-element/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter feed on Python using YQL and BeautifulSoup</title>
		<link>http://thetascript.com/twitter-feed-on-python-using-yql-and-beautifulsoup/</link>
		<comments>http://thetascript.com/twitter-feed-on-python-using-yql-and-beautifulsoup/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 07:05:00 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Beautiful Soup]]></category>

		<guid isPermaLink="false">http://onewithsomething.posterous.com/twitter-feed-on-python-using-yql-and-beautifu</guid>
		<description><![CDATA[<p>Uses YQL&#8217;s Rest query (select * from twitter.user.timeline where id=&#8217;vetri02&#8242;) import urllib2 from BeautifulSoup import BeautifulStoneSoup var = raw_input("Enter your Twitter id: ") print "Tweets of", var er = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20twitter.user.timeline%20where%20id%3D'" fg = "'&#38;diagnostics=true&#38;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" zx = er+var+fg page = urllib2.urlopen(zx) soup = BeautifulStoneSoup(page) tweet = soup.findAll('text') for twt in tweet: print twt.string On Github https://github.com/vetri02/Twitter-feed-on-Python-using-YQL-and-BeautifulSoup &#160; ...</p><p>The post <a href="http://thetascript.com/twitter-feed-on-python-using-yql-and-beautifulsoup/">Twitter feed on Python using YQL and BeautifulSoup</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>Uses YQL&#8217;s Rest query (select * from twitter.user.timeline where id=&#8217;vetri02&#8242;)</p>
<div class="CodeRay">
<div class="code">
<pre>import urllib2

from BeautifulSoup import BeautifulStoneSoup

var = raw_input("Enter your Twitter id: ")

print "Tweets of", var

er = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20twitter.user.timeline%20where%20id%3D'"

fg = "'&amp;diagnostics=true&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys"

zx = er+var+fg

page = urllib2.urlopen(zx)

soup = BeautifulStoneSoup(page)

tweet = soup.findAll('text')

for twt in tweet:

    print twt.string</pre>
</div>
</div>
<p>On Github</p>
<p><span><a href="https://github.com/vetri02/Twitter-feed-on-Python-using-YQL-and-BeautifulSoup">https://github.com/vetri02/Twitter-feed-on-Python-using-YQL-and-BeautifulSoup</a></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="http://thetascript.com/twitter-feed-on-python-using-yql-and-beautifulsoup/">Twitter feed on Python using YQL and BeautifulSoup</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/twitter-feed-on-python-using-yql-and-beautifulsoup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retreive data from google spreadsheet using python and beautiful soup</title>
		<link>http://thetascript.com/retreive-data-from-google-spreadsheet-using-python-and-beautiful-soup/</link>
		<comments>http://thetascript.com/retreive-data-from-google-spreadsheet-using-python-and-beautiful-soup/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 18:40:00 +0000</pubDate>
		<dc:creator>Vetrichelvan Jeyapalpandy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Beautiful Soup]]></category>

		<guid isPermaLink="false">http://onewithsomething.posterous.com/retreive-data-from-google-spreadsheet-using-p</guid>
		<description><![CDATA[<p>Create a spreadsheet on google doc share it and publish as web page ,take the url and put it instead of the URL pasted here on the code.You can retrieve the column values accordingly by changing the class name on soup.findAll (eg.:&#8217;class&#8217; : &#8216;s1&#8242;) import urllib2 from BeautifulSoup import BeautifulSoup page = urllib2.urlopen("https://spreadsheets.google.com/pub?key=0AujzeBNXnyI-dDNBRFJZaTZyRnZnMzdnQlFzSkRsd2c&#38;hl=en&#38;output=html") soup = ...</p><p>The post <a href="http://thetascript.com/retreive-data-from-google-spreadsheet-using-python-and-beautiful-soup/">Retreive data from google spreadsheet using python and beautiful soup</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Arial, sans-serif; font-size: 14px; line-height: 17px;">Create a spreadsheet on google doc share it and publish as web page ,take the url and put it instead of the URL pasted here on the code.You can retrieve the column values accordingly by changing the class name on soup.findAll (eg.:&#8217;class&#8217; : &#8216;s1&#8242;)</span></p>
<pre>
import urllib2
from BeautifulSoup import BeautifulSoup

page = urllib2.urlopen("https://spreadsheets.google.com/pub?key=0AujzeBNXnyI-dDNBRFJZaTZyRnZnMzdnQlFzSkRsd2c&amp;hl=en&amp;output=html")

soup = BeautifulSoup(page)
ted = soup.findAll('td',{ 'class' : 's1'})
for td in ted:
print td.string
</pre>
<p>The post <a href="http://thetascript.com/retreive-data-from-google-spreadsheet-using-python-and-beautiful-soup/">Retreive data from google spreadsheet using python and beautiful soup</a> appeared first on <a href="http://thetascript.com">Theta Script</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thetascript.com/retreive-data-from-google-spreadsheet-using-python-and-beautiful-soup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
