<?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; alias</title>
	<atom:link href="http://www.vidul.com/category/administration/alias/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vidul.com</link>
	<description>my web space</description>
	<lastBuildDate>Thu, 09 Sep 2010 22:51:55 +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>Converting Between Numeric Bases</title>
		<link>http://www.vidul.com/2008/07/31/converting-between-numeric-bases/</link>
		<comments>http://www.vidul.com/2008/07/31/converting-between-numeric-bases/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 06:58:00 +0000</pubDate>
		<dc:creator>Vidul</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[scripts]]></category>

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

# decimal to binary
alias d2b='ruby -e &#34;puts ARGV.first.to_i.to_s(2)&#34;'
# decimal to hexademical
alias d2h='ruby -e &#34;puts ARGV.first.to_i.to_s(16)&#34;'
# decimal to octal
alias d2o='ruby -e &#34;puts ARGV.first.to_i.to_s(8)&#34;'
&#160;
# binary to decimal
alias b2d='ruby -e &#34;puts eval(%q&#124;0b&#124; + ARGV.first)&#34;'
# binary to hexademical
alias b2h='ruby -e &#34;puts eval(%q&#124;0b&#124; + ARGV.first).to_s(16)&#34;'
# binary to octal
alias b2o='ruby -e &#34;puts eval(%q&#124;0b&#124; + ARGV.first).to_s(8)&#34;'
&#160;
# hexademical to decimal
alias h2d='ruby [...]]]></description>
			<content:encoded><![CDATA[<p>Sample .bashrc file:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:arial,verdana,monospace;"><span style="color:#008000; font-style:italic;"># decimal to binary</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> d2b=<span style="color:#996600;">'ruby -e &quot;puts ARGV.first.to_i.to_s(2)&quot;'</span>
<span style="color:#008000; font-style:italic;"># decimal to hexademical</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> d2h=<span style="color:#996600;">'ruby -e &quot;puts ARGV.first.to_i.to_s(16)&quot;'</span>
<span style="color:#008000; font-style:italic;"># decimal to octal</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> d2o=<span style="color:#996600;">'ruby -e &quot;puts ARGV.first.to_i.to_s(8)&quot;'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># binary to decimal</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> b2d=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0b| + ARGV.first)&quot;'</span>
<span style="color:#008000; font-style:italic;"># binary to hexademical</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> b2h=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0b| + ARGV.first).to_s(16)&quot;'</span>
<span style="color:#008000; font-style:italic;"># binary to octal</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> b2o=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0b| + ARGV.first).to_s(8)&quot;'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># hexademical to decimal</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> h2d=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0x| + ARGV.first)&quot;'</span>
<span style="color:#008000; font-style:italic;"># hexademical to binary</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> h2b=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0x| + ARGV.first).to_s(2)&quot;'</span>
<span style="color:#008000; font-style:italic;"># hexademical to octal</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> h2o=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0x| + ARGV.first).to_s(8)&quot;'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># octal to decimal</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> o2d=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0o| + ARGV.first)&quot;'</span>
<span style="color:#008000; font-style:italic;"># octal to binary</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> o2b=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0o| + ARGV.first).to_s(2)&quot;'</span>
<span style="color:#008000; font-style:italic;"># octal to hexademical</span>
<span style="color:#9966CC; font-weight:bold;">alias</span> o2h=<span style="color:#996600;">'ruby -e &quot;puts eval(%q|0o| + ARGV.first).to_s(16)&quot;'</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/31/converting-between-numeric-bases/&amp;Title=Converting+Between+Numeric+Bases" 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/31/converting-between-numeric-bases/&amp;title=Converting+Between+Numeric+Bases" 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/31/converting-between-numeric-bases/&amp;title=Converting+Between+Numeric+Bases" 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/31/converting-between-numeric-bases/&amp;title=Converting+Between+Numeric+Bases" 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/31/converting-between-numeric-bases/&amp;title=Converting+Between+Numeric+Bases" 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/31/converting-between-numeric-bases/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Converting+Between+Numeric+Bases+-+http://b2l.me/bm4mr+" 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/31/converting-between-numeric-bases/&amp;h=Converting+Between+Numeric+Bases" 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/31/converting-between-numeric-bases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
