<?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>ChrisBellini.com &#187; Hacks</title>
	<atom:link href="http://www.chrisbellini.com/category/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisbellini.com</link>
	<description>test</description>
	<lastBuildDate>Mon, 21 Dec 2009 02:04:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>quick calc</title>
		<link>http://www.chrisbellini.com/2006/11/02/quick-calc/</link>
		<comments>http://www.chrisbellini.com/2006/11/02/quick-calc/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 12:12:39 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.chrisbellini.com/?p=561</guid>
		<description><![CDATA[Often, I need to do some quick arithmetic involving multiple operations and don't have a good calculator handy.  There's a calculator application on my cell phone, but I'm an atrociously slow cell phone typer.  Most simple calculator apps, like calc.exe in Windows, are fine for single operations like 2+2 or 67 * 1.14, [...]]]></description>
			<content:encoded><![CDATA[<p>Often, I need to do some quick arithmetic involving multiple operations and don't have a good calculator handy.  There's a calculator application on my cell phone, but I'm an atrociously slow cell phone typer.  Most simple calculator apps, like <em>calc.exe</em> in Windows, are fine for single operations like 2+2 or 67 * 1.14, but for multiple-operation expressions, those simple apps won't cut it without needing to resort to some copy 'n' pasting or [gasp] manual jotting with a writing utensil.</p>
<p>When I'm in front of a computer and I need to quickly calculate an arithmetic expression to figure out sales tax, find averages, multiply numbers too large for my brain to deal with, etc, writing a script or a total application would be overkill.  Here are the <a href="http://en.wikipedia.org/wiki/Cross-platform" target="_blank">cross-platform</a> solutions that I find myself resorting to:</p>
<p><strong>Python (<a href="http://www.python.org" target="_blank">python.org</a>)</strong><br />
<img src="images/blog/idle_calc.jpg" border="0" alt="Python's IDLE" /><br />
Python's interpreter is convenient.  It allows you to enter any mathematical express and it will evaluate it as if it were a line in a Python script.  You could even assign values to variables or other data structures, use loops, conditions, and create functions like you would in any ol' script.</p>
<p><strong>Ruby (<a href="http://www.ruby-lang.org" target="_blank">ruby-lang.org</a>)</strong><br />
<img src="images/blog/irb-fxri_calc.jpg" border="0" alt="Ruby's IRB" /><br />
Ruby's interpreter has nearly identical features to Python's interpreter, except that the language is Ruby instead of Python...duh <img src='http://www.chrisbellini.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Mozilla Firefox JavaScript Error Console (<a href="http://www.mozilla.org/firefox/" target="_blank">mozilla.org/firefox/</a>)</strong><br />
In Firefox, selecting "Error Console" from the Tools menu item will launch the JavaScript Error Console window.  The Error Console is useful for debugging JavaScript in Web applications.  However, much like Python's and Ruby's interpreter, it too can quickly evaluate arithmetic expressions.  Its main shortcoming, when compared to the aforementioned Python and Ruby interpreters, is that can only evaluate one line at a time.  So you cannot store data in variables, since once you click the evaluate button, your variables are destroyed.<br />
<img src="images/blog/firefox_calc.jpg" border="0" alt="Firefox's JavaScript Error Console" /></p>
<p><strong>Google (<a href="http://www.google.com" target="_blank">google.com</a>)</strong><br />
Google's powerful searching abilities are one thing, but did you know that it can also perform calculations (Ex: <a href="http://www.google.ca/search?hl=en&q=%2899*66%29%5E2&btnG=Google+Search&meta=" target="_blank">(99*66)<sup>2</sup></a>), unit conversions (Ex: <a href="http://www.google.ca/search?hl=en&q=120+kilometres+in+miles&btnG=Search&meta=" target="_blank">120 kilometres in miles</a>) and even unit+currency conversion (Ex: <a href="http://www.google.com/search?hl=en&lr=&q=%242.85+per+gallon+in+Canadian+money+per+liter&btnG=Search" target="_blank">help the in laws figure out Canadian gas prices</a> ).</p>
<p><strong>Instacalc (<a href="http://instacalc.com" target="_blank">instacalc.com</a>)</strong><br />
I've just recently come across this website and haven't explored all of the features yet.  However, it looks very promising.  Using <a href="http://en.wikipedia.org/wiki/AJAX" target="_blank">AJAX</a> to display answers as you type in your expression is a nice touch.</p>
<p>For <a href="http://www.microsoft.com/windows/" target="_blank">Windows</a> users, there's also the <a href="http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/PowerCalcPowertoySetup.exe" target="_blank">Power Calculator</a> that's part of the suite of <a href="http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx" target="_blank">Windows XP PowerToys</a>.  I keep it bound to the Calculator key on my keyboard.</p>
<p>better calculators + me = happy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisbellini.com/2006/11/02/quick-calc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
