Math-Intensive Reports with GNU Emacs and Calc, Part 1
Notice that my example kept track of units. It's able to do so because Calc also can perform symbolic algebra (a subject far too large for this small article) and treats the symbol "in" (inches) as an undetermined factor. Special operations are available to convert units. Calc knows about units and their conversion. For example, how many pints does a lake having 11,000 acre-feet of water contain? To find out, I first write out the volume in the given units:
$ WaterVolume := 11000. acre ft $
Now, if I type the expression WaterVolume => and evaluate it, I get this:
$ WaterVolume => 11000. acre ft $
Exactly what I typed in. Next, by putting the cursor over the acre unit, selecting (with j s and <codej m commands) the units expression (11000. acre ft) and invoking u c (units-convert), Calc will ask me what type of unit should be used in the conversion. I respond pt. Then Calc immediately changes the previous expression to this:
$ WaterVolume => 28674925714.3 pt $
Obviously, Calc knows how to convert an acre-foot to pints, and doing so is much quicker than describing it.
You don't have to use units at all if you don't want to. If you carefully define all your units up front and use them consistently throughout your report, Calc won't have to do any units munging. But it is useful for converting weird commercial units; it can be handy for converting, say, gas pipeline flow rates in MMSCFD into pounds mass per second.
More examples of Emacs/Calc magic will be presented in Part 2 of this article.
General description: www.gnu.org/software/software.html
FTP mirror list & instructions for downloading: www.gnu.org/order/ftp.html
Emacs Wiki: www.emacswiki.org/cgi-bin/wiki.pl
The Emacs Lisp Archive: archive.cis.ohio-state.edu/pub/emacs-lisp
The Emacs Lisp List: thalamus.wustl.edu/wonglab/stephen/ell/ell.html
Download code and documentation: mirrors.sunsite.dk/auctex/www/auctex
Download code and documentation: www.octave.org
|Free Today: September Issue of Linux Journal (Retail value: $5.99)||Sep 27, 2016|
|nginx||Sep 27, 2016|
|Epiq Solutions' Sidekiq M.2||Sep 26, 2016|
|Nativ Disc||Sep 23, 2016|
|Android Browser Security--What You Haven't Been Told||Sep 22, 2016|
|The Many Paths to a Solution||Sep 21, 2016|
- Free Today: September Issue of Linux Journal (Retail value: $5.99)
- Android Browser Security--What You Haven't Been Told
- Readers' Choice Awards 2013
- Epiq Solutions' Sidekiq M.2
- Downloading an Entire Web Site with wget
- The Many Paths to a Solution
- Securing the Programmer
- Nativ Disc
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
Pick up any e-commerce web or mobile app today, and you’ll be holding a mashup of interconnected applications and services from a variety of different providers. For instance, when you connect to Amazon’s e-commerce app, cookies, tags and pixels that are monitored by solutions like Exact Target, BazaarVoice, Bing, Shopzilla, Liveramp and Google Tag Manager track every action you take. You’re presented with special offers and coupons based on your viewing and buying patterns. If you find something you want for your birthday, a third party manages your wish list, which you can share through multiple social- media outlets or email to a friend. When you select something to buy, you find yourself presented with similar items as kind suggestions. And when you finally check out, you’re offered the ability to pay with promo codes, gifts cards, PayPal or a variety of credit cards.Get the Guide