<?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; chars</title>
	<atom:link href="http://www.vidul.com/category/python/chars/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vidul.com</link>
	<description>my web space</description>
	<lastBuildDate>Wed, 11 Aug 2010 06:22:44 +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>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>
	</channel>
</rss>
