<?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>Vidul Nikolaev Petrov &#187; Python</title>
	<atom:link href="http://www.vidul.com/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vidul.com</link>
	<description>my web space</description>
	<lastBuildDate>Fri, 09 Apr 2010 21:01:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Christmas names</title>
		<link>http://www.vidul.com/2009/12/15/christmas-names/</link>
		<comments>http://www.vidul.com/2009/12/15/christmas-names/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 04:15:27 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=516</guid>
		<description><![CDATA[
&#62;&#62;&#62;from nltk.corpus import wordnet as wn
&#160;
&#62;&#62;&#62;wn.synsets&#40;'Christmas'&#41;&#91;0&#93;.lemma_names
&#160;
&#91;'Christmas', 'Christmastide', 'Christmastime', 'Yule', 'Yuletide', 'Noel'&#93;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span>from nltk.<span style="color: black;">corpus</span> <span style="color: #ff7700;font-weight:bold;">import</span> wordnet <span style="color: #ff7700;font-weight:bold;">as</span> wn
&nbsp;
<span style="color: #66cc66;">&gt;&gt;&gt;</span>wn.<span style="color: black;">synsets</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Christmas'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">lemma_names</span>
&nbsp;
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'Christmas'</span>, <span style="color: #483d8b;">'Christmastide'</span>, <span style="color: #483d8b;">'Christmastime'</span>, <span style="color: #483d8b;">'Yule'</span>, <span style="color: #483d8b;">'Yuletide'</span>, <span style="color: #483d8b;">'Noel'</span><span style="color: black;">&#93;</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/12/15/christmas-names/&amp;Title=Christmas+names" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/12/15/christmas-names/&amp;title=Christmas+names" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/12/15/christmas-names/&amp;title=Christmas+names" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/12/15/christmas-names/&amp;title=Christmas+names" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/12/15/christmas-names/&amp;title=Christmas+names" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/12/15/christmas-names/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Christmas+names+-+http://b2l.me/bj8a5+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/12/15/christmas-names/&amp;h=Christmas+names" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/12/15/christmas-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the actual meaning of &#8220;Merry Christmas&#8221;</title>
		<link>http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/</link>
		<comments>http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 04:01:55 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[Christmas]]></category>

		<guid isPermaLink="false">http://www.vidul.com/?p=493</guid>
		<description><![CDATA[
import re
&#160;
greeting = &#34;Merry Christmas&#34;
&#160;
greeting_list = map&#40;chr, &#91;ord&#40;i&#41; - len&#40;greeting&#41; - 1 for i in greeting&#93;&#41;
greeting_list = set&#40;filter&#40;lambda x: re.match&#40;'[a-z]&#124;[A-Z]', x&#41;, greeting_list&#41;&#41;
&#160;
# greeting_list is set(['c', 'b', 'd', 'i', 'Q', 'U', 'Y', 'X'])
# the 1st 3 elements are not clear to me: c,b,d
# 'i' means 'I', 'Q' means 'question', 'U' means 'you', 'Y' means 'why', 'X' [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
greeting = <span style="color: #483d8b;">&quot;Merry Christmas&quot;</span>
&nbsp;
greeting_list = <span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #008000;">chr</span>, <span style="color: black;">&#91;</span><span style="color: #008000;">ord</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> - <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>greeting<span style="color: black;">&#41;</span> - <span style="color: #ff4500;">1</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> greeting<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
greeting_list = <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: #008000;">filter</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> x: <span style="color: #dc143c;">re</span>.<span style="color: black;">match</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'[a-z]|[A-Z]'</span>, x<span style="color: black;">&#41;</span>, greeting_list<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># greeting_list is set(['c', 'b', 'd', 'i', 'Q', 'U', 'Y', 'X'])</span>
<span style="color: #808080; font-style: italic;"># the 1st 3 elements are not clear to me: c,b,d</span>
<span style="color: #808080; font-style: italic;"># 'i' means 'I', 'Q' means 'question', 'U' means 'you', 'Y' means 'why', 'X' means 'Christmas'</span>
<span style="color: #808080; font-style: italic;"># which makes the compound: 'I question you - why Christmas?'</span></pre></div></div>

<p>Right?</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/&amp;Title=the+actual+meaning+of+%22Merry+Christmas%22" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/&amp;title=the+actual+meaning+of+%22Merry+Christmas%22" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/&amp;title=the+actual+meaning+of+%22Merry+Christmas%22" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/&amp;title=the+actual+meaning+of+%22Merry+Christmas%22" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/&amp;title=the+actual+meaning+of+%22Merry+Christmas%22" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=the+actual+meaning+of+%22Merry+Christmas%22+-+http://b2l.me/bj27x+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/&amp;h=the+actual+meaning+of+%22Merry+Christmas%22" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/12/14/the-actually-meaning-of-merry-christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade Trac seamlessly</title>
		<link>http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/</link>
		<comments>http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 14:53:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Trac]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[ Find your Trac path:
python -c&#8217;import trac;print trac&#8217;
Edit env.py on line 598:

1
2
3
4
5
6
if needs_upgrade:
    try:
        os.system&#40;&#34;/usr/bin/trac-admin %s upgrade&#34; % env_path&#41;
    except TracError:
        raise TracError&#40;_&#40;'The Trac Environment needs to be upgraded.\n\n'
       [...]]]></description>
			<content:encoded><![CDATA[<p><em> Find your Trac path:</em></p>
<p><strong>python -c&#8217;import trac;print trac&#8217;</strong></p>
<p><em>Edit env.py on line 598:</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:arial,verdana,monospace;"><span style="color: #ff7700;font-weight:bold;">if</span> needs_upgrade:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;/usr/bin/trac-admin %s upgrade&quot;</span> <span style="color: #66cc66;">%</span> env_path<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> TracError:
        <span style="color: #ff7700;font-weight:bold;">raise</span> TracError<span style="color: black;">&#40;</span>_<span style="color: black;">&#40;</span><span style="color: #483d8b;">'The Trac Environment needs to be upgraded.<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span>
                              <span style="color: #483d8b;">'Run &quot;trac-admin %(path)s upgrade&quot;'</span>, path=env_path<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p><em>Restart Trac daemon ot whatever http server is serving it.</em></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/&amp;Title=Upgrade+Trac+seamlessly" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/&amp;title=Upgrade+Trac+seamlessly" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/&amp;title=Upgrade+Trac+seamlessly" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/&amp;title=Upgrade+Trac+seamlessly" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/&amp;title=Upgrade+Trac+seamlessly" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Upgrade+Trac+seamlessly+-+http://b2l.me/bj3ds+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/&amp;h=Upgrade+Trac+seamlessly" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/11/28/upgrade-trac-seamlessly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Alphabet</title>
		<link>http://www.vidul.com/2009/10/20/the-alphabet/</link>
		<comments>http://www.vidul.com/2009/10/20/the-alphabet/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 17:35:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[chars]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[Python


import re
&#160;
_char = re.compile&#40;r'\w'&#41;
&#160;
''.join&#40;&#91;chr&#40;i&#41; for i in xrange&#40;65,122&#41; if _char.match&#40;chr&#40;i&#41;&#41;&#93;&#41;
&#160;
# or just:
import string
&#160;
string.ascii_letters
string.ascii_lowercase
string.ascii_uppercase


Ruby


&#40;65..122&#41;.to_a.map&#123; &#124;e&#124; e.chr =~ /\w/ &#38;&#38; e.chr &#125;.compact.to_s


Perl


$chars .= chr&#40;&#41; =~ /\w/ ? chr&#40;&#41; : q&#123;&#125; for 65..122;


I don&#8217;t like the mess of Ruby, and Perl.





		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Python</strong></p>
<div class="typocode">

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
_char = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\w</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #008000;">chr</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">65</span>,<span style="color: #ff4500;">122</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> _char.<span style="color: black;">match</span><span style="color: black;">&#40;</span><span style="color: #008000;">chr</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># or just:</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">string</span>
&nbsp;
<span style="color: #dc143c;">string</span>.<span style="color: black;">ascii_letters</span>
<span style="color: #dc143c;">string</span>.<span style="color: black;">ascii_lowercase</span>
<span style="color: #dc143c;">string</span>.<span style="color: black;">ascii_uppercase</span></pre></div></div>

</div>
<p><strong>Ruby</strong></p>
<div class="typocode">

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#006600; font-weight:bold;">&#40;</span>65..122<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>e<span style="color:#006600; font-weight:bold;">|</span> e.<span style="color:#9900CC;">chr</span> =~ <span style="color:#006600; font-weight:bold;">/</span>\w<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> e.<span style="color:#9900CC;">chr</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">compact</span>.<span style="color:#9900CC;">to_s</span></pre></div></div>

</div>
<p><strong>Perl</strong></p>
<div class="typocode">

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:arial,verdana,monospace;"><span style="color: #0000ff;">$chars</span> <span style="color: #339933;">.=</span> <span style="color: #000066;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/\w/</span> <span style="color: #339933;">?</span> <span style="color: #000066;">chr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000066;">q</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">for</span> 65<span style="color: #339933;">..</span>122<span style="color: #339933;">;</span></pre></div></div>

</div>
<p>I don&#8217;t like the mess of Ruby, and Perl.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2009/10/20/the-alphabet/&amp;Title=The+Alphabet" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2009/10/20/the-alphabet/&amp;title=The+Alphabet" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2009/10/20/the-alphabet/&amp;title=The+Alphabet" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2009/10/20/the-alphabet/&amp;title=The+Alphabet" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2009/10/20/the-alphabet/&amp;title=The+Alphabet" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2009/10/20/the-alphabet/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=The+Alphabet+-+http://b2l.me/bj3dt+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2009/10/20/the-alphabet/&amp;h=The+Alphabet" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2009/10/20/the-alphabet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering Lists</title>
		<link>http://www.vidul.com/2008/12/01/filtering-lists/</link>
		<comments>http://www.vidul.com/2008/12/01/filtering-lists/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 08:33:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[Ruby

arr = &#40;1..10&#41;.to_a
arr.select&#123; &#124;e&#124; e % 2 != 0 &#125;

Python

arr = range&#40;1,11&#41;
&#91;e for e in arr if e % 2&#93;

Perl

@arr = &#40;1..10&#41;;
grep&#40;$_ % 2, @arr&#41;;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[<p><strong>Ruby</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;">arr = <span style="color:#006600; font-weight:bold;">&#40;</span>1..10<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span>
arr.<span style="color:#CC0066; font-weight:bold;">select</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>e<span style="color:#006600; font-weight:bold;">|</span> e <span style="color:#006600; font-weight:bold;">%</span> <span style="color:#006666;">2</span> != <span style="color:#006666;">0</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p><strong>Python</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;">arr = <span style="color: #008000;">range</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>,<span style="color: #ff4500;">11</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#91;</span>e <span style="color: #ff7700;font-weight:bold;">for</span> e <span style="color: #ff7700;font-weight:bold;">in</span> arr <span style="color: #ff7700;font-weight:bold;">if</span> e <span style="color: #66cc66;">%</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Perl</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#0066ff; font-weight:bold;">@arr</span> = <span style="color:#006600; font-weight:bold;">&#40;</span>1..10<span style="color:#006600; font-weight:bold;">&#41;</span>;
grep<span style="color:#006600; font-weight:bold;">&#40;</span>$_ <span style="color:#006600; font-weight:bold;">%</span> <span style="color:#006666;">2</span>, <span style="color:#0066ff; font-weight:bold;">@arr</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2008/12/01/filtering-lists/&amp;Title=Filtering+Lists" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2008/12/01/filtering-lists/&amp;title=Filtering+Lists" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2008/12/01/filtering-lists/&amp;title=Filtering+Lists" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2008/12/01/filtering-lists/&amp;title=Filtering+Lists" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2008/12/01/filtering-lists/&amp;title=Filtering+Lists" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2008/12/01/filtering-lists/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Filtering+Lists+-+http://b2l.me/bmbmg+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2008/12/01/filtering-lists/&amp;h=Filtering+Lists" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2008/12/01/filtering-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Email Hex Encoding</title>
		<link>http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/</link>
		<comments>http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 20:30:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[
#!/usr/bin/python
&#160;
import re
&#160;
hex_encode = lambda x: &#40;&#34;&#38;#%i;&#34; * len&#40;x&#41;&#41; % &#40;tuple&#40;map&#40;ord, re.findall&#40;'.', x&#41;&#41;&#41;&#41;
&#160;
# hex_encode(&#34;root@example.com&#34;) =&#62;;
# &#38;#114;&#38;#111;&#38;#111;&#38;#116;&#38;#64;&#38;#118;&#38;#105;&#38;#100;&#38;#117;&#38;#108;&#38;#46;&#38;#99;&#38;#111;&#38;#109;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
hex_encode = <span style="color: #ff7700;font-weight:bold;">lambda</span> x: <span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&amp;#%i;&quot;</span> <span style="color: #66cc66;">*</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: #008000;">tuple</span><span style="color: black;">&#40;</span><span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #008000;">ord</span>, <span style="color: #dc143c;">re</span>.<span style="color: black;">findall</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'.'</span>, x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># hex_encode(&quot;root@example.com&quot;) =&gt;;</span>
<span style="color: #808080; font-style: italic;"># &amp;#114;&amp;#111;&amp;#111;&amp;#116;&amp;#64;&amp;#118;&amp;#105;&amp;#100;&amp;#117;&amp;#108;&amp;#46;&amp;#99;&amp;#111;&amp;#109;</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/&amp;Title=Simple+Email+Hex+Encoding" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/&amp;title=Simple+Email+Hex+Encoding" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/&amp;title=Simple+Email+Hex+Encoding" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/&amp;title=Simple+Email+Hex+Encoding" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/&amp;title=Simple+Email+Hex+Encoding" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Simple+Email+Hex+Encoding+-+http://b2l.me/bmz2n+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/&amp;h=Simple+Email+Hex+Encoding" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2008/11/18/simple-hex-encoding-for-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sequence Types and Slice</title>
		<link>http://www.vidul.com/2008/10/21/sequence-types-and-slice/</link>
		<comments>http://www.vidul.com/2008/10/21/sequence-types-and-slice/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 12:08:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[Ruby slice:

a = &#91;1, 2, 3, 4, 5, 6&#93;
a&#91;0..-1&#93; # [1, 2, 3, 4, 5, 6]
a&#91;&#40;0..-1&#41;&#93; # tha same

Python slice:

a = &#91;1, 2, 3, 4, 5, 6&#93;
a&#91;:-1&#93; # [1, 2, 3, 4, 5]
a&#91;:&#93; # [1, 2, 3, 4, 5, 6]
a&#91;0:len&#40;a&#41;:2&#93; # [2, 4, 6]  Nice, isn't it?






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Ruby</strong> slice:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;">a = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span>, <span style="color:#006666;">4</span>, <span style="color:#006666;">5</span>, <span style="color:#006666;">6</span><span style="color:#006600; font-weight:bold;">&#93;</span>
a<span style="color:#006600; font-weight:bold;">&#91;</span>0..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;"># [1, 2, 3, 4, 5, 6]</span>
a<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#40;</span>0..<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;"># tha same</span></pre></div></div>

<p><strong>Python</strong> slice:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;">a = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span>, <span style="color:#006666;">4</span>, <span style="color:#006666;">5</span>, <span style="color:#006666;">6</span><span style="color:#006600; font-weight:bold;">&#93;</span>
a<span style="color:#006600; font-weight:bold;">&#91;</span>:<span style="color:#006600; font-weight:bold;">-</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;"># [1, 2, 3, 4, 5]</span>
a<span style="color:#006600; font-weight:bold;">&#91;</span>:<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;"># [1, 2, 3, 4, 5, 6]</span>
a<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>:len<span style="color:#006600; font-weight:bold;">&#40;</span>a<span style="color:#006600; font-weight:bold;">&#41;</span>:<span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;"># [2, 4, 6]  Nice, isn't it?</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2008/10/21/sequence-types-and-slice/&amp;Title=Sequence+Types+and+Slice" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2008/10/21/sequence-types-and-slice/&amp;title=Sequence+Types+and+Slice" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2008/10/21/sequence-types-and-slice/&amp;title=Sequence+Types+and+Slice" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2008/10/21/sequence-types-and-slice/&amp;title=Sequence+Types+and+Slice" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2008/10/21/sequence-types-and-slice/&amp;title=Sequence+Types+and+Slice" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2008/10/21/sequence-types-and-slice/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Sequence+Types+and+Slice+-+http://b2l.me/bmwcw+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2008/10/21/sequence-types-and-slice/&amp;h=Sequence+Types+and+Slice" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2008/10/21/sequence-types-and-slice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>three ways to print the alphabet</title>
		<link>http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/</link>
		<comments>http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 08:55:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[alphabet]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[String methods:

&#34;a&#34;.upto&#40;&#34;z&#34;&#41;&#123; &#124;i&#124; puts i &#125;


a = String.new &#34;a&#34;
0.upto&#40;0&#41;&#123; p a &#125;
1.upto&#40;25&#41;&#123; p a.next! &#125;

Range method:

&#40;&#34;a&#34;..&#34;z&#34;&#41;.each&#123; &#124;e&#124; puts e &#125;






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? Share it on StumbleUpon
		
		
			Share this on Technorati
		
		
			Tweet This!
		
		
			Seed this on Newsvine
		





]]></description>
			<content:encoded><![CDATA[<p><strong>String methods</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#996600;">&quot;a&quot;</span>.<span style="color:#9900CC;">upto</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;z&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>i<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">puts</span> i <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;">a = <span style="color:#CC0066; font-weight:bold;">String</span>.<span style="color:#9900CC;">new</span> <span style="color:#996600;">&quot;a&quot;</span>
0.<span style="color:#9900CC;">upto</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#CC0066; font-weight:bold;">p</span> a <span style="color:#006600; font-weight:bold;">&#125;</span>
1.<span style="color:#9900CC;">upto</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">25</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#CC0066; font-weight:bold;">p</span> a.<span style="color:#9966CC; font-weight:bold;">next</span>! <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p><strong>Range method</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;a&quot;</span>..<span style="color:#996600;">&quot;z&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>e<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">puts</span> e <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/&amp;Title=three+ways+to+print+the+alphabet" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/&amp;title=three+ways+to+print+the+alphabet" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/&amp;title=three+ways+to+print+the+alphabet" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/&amp;title=three+ways+to+print+the+alphabet" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/&amp;title=three+ways+to+print+the+alphabet" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=three+ways+to+print+the+alphabet+-+http://b2l.me/bm5py+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/&amp;h=three+ways+to+print+the+alphabet" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2008/07/27/three-ways-to-print-the-alphabet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lists and Values</title>
		<link>http://www.vidul.com/2007/11/30/list-values-and-arrays/</link>
		<comments>http://www.vidul.com/2007/11/30/list-values-and-arrays/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 14:28:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">urn:uuid:{a.guid}</guid>
		<description><![CDATA[Perl

&#40;$a, $b&#41; = &#40;1, 2&#41;;
@arr    = &#40;1, 2&#41;;

Python

 a, b = 1, 2
arr = 1, 
arr = 1,2

Ruby

 a, b = 1, 2
arr  = 1, 2
arr  = 1,2, *&#91;11,22&#93; # the same as
arr  = &#91;1,2, &#91;11,22&#93;&#93;.flatten






		
			Share this on Blinklist
		
		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Share this on Reddit
		
		
			Stumble upon something good? [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Perl</strong></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:arial,verdana,monospace;"><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$a</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$b</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">@arr</span>    <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Python</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:arial,verdana,monospace;"> a, b = <span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span>
arr = <span style="color: #ff4500;">1</span>, 
arr = <span style="color: #ff4500;">1</span>,<span style="color: #ff4500;">2</span></pre></div></div>

<p><strong>Ruby</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"> a, b = <span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>
arr  = <span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>
arr  = <span style="color:#006666;">1</span>,<span style="color:#006666;">2</span>, <span style="color:#006600; font-weight:bold;">*</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">11</span>,<span style="color:#006666;">22</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;"># the same as</span>
arr  = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>,<span style="color:#006666;">2</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">11</span>,<span style="color:#006666;">22</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">flatten</span></pre></div></div>



<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-blinklist">
			<a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.vidul.com/2007/11/30/list-values-and-arrays/&amp;Title=Lists+and+Values" rel="nofollow" title="Share this on Blinklist">Share this on Blinklist</a>
		</li>
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.vidul.com/2007/11/30/list-values-and-arrays/&amp;title=Lists+and+Values" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.vidul.com/2007/11/30/list-values-and-arrays/&amp;title=Lists+and+Values" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.vidul.com/2007/11/30/list-values-and-arrays/&amp;title=Lists+and+Values" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.vidul.com/2007/11/30/list-values-and-arrays/&amp;title=Lists+and+Values" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.vidul.com/2007/11/30/list-values-and-arrays/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Lists+and+Values+-+http://b2l.me/bmn5x+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-newsvine">
			<a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.vidul.com/2007/11/30/list-values-and-arrays/&amp;h=Lists+and+Values" rel="nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

]]></content:encoded>
			<wfw:commentRss>http://www.vidul.com/2007/11/30/list-values-and-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
