programmer's calculator

  • Follow


My venerable solar programmer calculator Sharp El-545 is on its last
legs.  What do you use for a hand held programmer calculator? Mostly I
would like it to convert hex <-> decimal and do trig functions.

Perhaps one that could do conversion of units, metric <-> imperial.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/12/2011 5:08:13 AM

On 12-02-11 06:08, Roedy Green wrote:
> My venerable solar programmer calculator Sharp El-545 is on its last
> legs.  What do you use for a hand held programmer calculator? Mostly I
> would like it to convert hex <-> decimal and do trig functions.
> 

http://mindprod.com/project/hexcalc.html

> Perhaps one that could do conversion of units, metric <-> imperial.


hmm, imperal, thats what they use in the UK....?

http://www.google.com/#sclient=psy&hl=en&q=1+km+in+yards&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.1,or.&fp=92188ee12107320c

;)


-- 
Luuk
0
Reply Luuk 2/12/2011 9:39:26 AM


Roedy Green wrote:
> My venerable solar programmer calculator Sharp El-545 is on its last
> legs.  What do you use for a hand held programmer calculator? Mostly I
> would like it to convert hex<->  decimal and do trig functions.
>
> Perhaps one that could do conversion of units, metric<->  imperial.

I use an Android app, thus bringing this thread on topic for comp.lang. *java* 
..programmer.

It does trig but apparently not hex.  It has a great usability feature - in 
portrait orientation it's a simple arithmetic calculator.  In landscape 
orientation it adds nifty trig, radical and other buttons.  You don't have to 
press a button to change modes, just tilt the phone.  Slick!

-- 
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/  | *\##|
|#/ * |   \#|
|#----|----#|
||    |  * ||
|o *  |    o|
|_____|_____|
|===========|
0
Reply Lew 2/12/2011 2:39:39 PM

On Sat, 12 Feb 2011 10:39:26 +0100, Luuk <Luuk@invalid.lan> wrote,
quoted or indirectly quoted someone who said :

>hmm, imperal, thats what they use in the UK....?
 
The Brits now use metric.  The Americans still use the old British
system. I have been calling it "imperial". What do Americans call it?

I have Java macros all over my website to display in both systems.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/12/2011 6:43:18 PM

On 12-02-11 19:43, Roedy Green wrote:
> On Sat, 12 Feb 2011 10:39:26 +0100, Luuk <Luuk@invalid.lan> wrote,
> quoted or indirectly quoted someone who said :
> 
>> hmm, imperal, thats what they use in the UK....?
>  
> The Brits now use metric.  The Americans still use the old British
> system. I have been calling it "imperial". What do Americans call it?
> 
> I have Java macros all over my website to display in both systems.
> 

o, its just Americans.. than i wont bother and point them to Google
(also American) who can do the conversion too.

And, THEY, are the expection, at least according to:
http://en.wikipedia.org/wiki/International_System_of_Units



-- 
Luuk
0
Reply Luuk 2/12/2011 6:52:39 PM

On 2/12/2011 1:43 PM, Roedy Green wrote:
> On Sat, 12 Feb 2011 10:39:26 +0100, Luuk<Luuk@invalid.lan>  wrote,
> quoted or indirectly quoted someone who said :
>
>> hmm, imperal, thats what they use in the UK....?
>
> The Brits now use metric.  The Americans still use the old British
> system. I have been calling it "imperial". What do Americans call it?

     Not "imperial," that's for sure.  Your gallons are too fat.

-- 
Eric Sosman
esosman@ieee-dot-org.invalid
0
Reply Eric 2/12/2011 8:07:42 PM

On Sat, 12 Feb 2011 19:52:39 +0100, Luuk <Luuk@invalid.lan> wrote,
quoted or indirectly quoted someone who said :

>o, its just Americans.. than i wont bother and point them to Google
>(also American) who can do the conversion too.
>
>And, THEY, are the expection, at least according to:
>http://en.wikipedia.org/wiki/International_System_of_Units

I remember doing high voltage transmission line design using
"imperial" units of measure. How dangerous!  Even back then in the
days of punch cards, I tried to talk my boss into letting me do all
calculations internally in metric and convert only for i/o.

I figured FORTRAN needed a "units of measure" feature so it could
handle the conversions for you safely, and check the dimensionality of
each statement.  Now that Canadian engineers use metric, the need is
not so pressing. There is supposed to be an evolved Java called
Fortress coming with engineering features.

Americans consider metric effete, which I suppose is mainly an excuse
sticking with the old familiar measure. It must cost them a bundle in
trade not manufacturing to metric standards with metric documentation
or maintaining dual versions for domestic and foreign markets. Perhaps
it is a subtle protectionist measure.

Google results suggests Americans call this "English" measure, which
is a confusing name for it given that the English now use metric.  One
source suggested the British were slow to adopt metric because it was
invented by their political rivals the French.  Americans too have
dislike for the French which makes no sense to me, since without the
help of the French navy, the Americans would not have been successful
in their founding rebellion.

Pulling this back to Java.  My macros deal with alternate names for
various units of measure, and the imperial habit of having several
different units for measuring the same thing, e.g. pint, quart,
gallon. When you convert liters to imperial it decides on whether to
use pints, quarts, gallons etc based to the magnitude.  Similarly it
knows how to use metric prefixes when going the other way.  You can
cannibalise this logic for your own program.

see
http://wush.net/svn/mindprod/com/mindprod/htmlmacros/UnitsOfMeasure.java
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/12/2011 10:29:15 PM

Luuk wrote:
> o, [sic] its [sic] just Americans.. [sic] than [sic] i [sic] wont [sic] bother and [sic] point them to Google
> (also American) who can do the conversion [sic] too.
>
> And, THEY, are the expection,

Nice pun.  The superfluous commas should go, though.

> at least according to:
> http://en.wikipedia.org/wiki/International_System_of_Units

Americans refer to Imperial units as the "English" system.

And the reason we don't switch is that we're smart enough to handle the more 
complex system, and thus have no need for the simplification that decimal 
represents.  You will note that we did convert to metric for alcoholic 
beverage volume (wines and stronger only).  That's because drunk people need 
the benefit of the simpler system.  Otherwise we're a nation of geniuses and 
have no need nor desire for the decimal dumbing down.

Really, duodecimal is better anyway.

-- 
Lew
Honi soit qui mal y pense.
0
Reply Lew 2/12/2011 10:33:12 PM

On 2/12/2011 5:29 PM, Roedy Green wrote:
> [...]
> Google results suggests Americans call this "English" measure, which
> is a confusing name for it given that the English now use metric.[...]

     As the old saying goes: In for a penny, in for a hundred new pence.

-- 
Eric Sosman
esosman@ieee-dot-org.invalid
0
Reply Eric 2/12/2011 10:43:02 PM

Roedy Green wrote:
>> [...]
>> Google results suggests Americans call this "English" measure, which
>> is a confusing name for it given that the English now use metric.[...]

Not really confusing, at least not for us Americans.  We remember the English 
from when they used their own system and said "veddy" for "very".  We're 
traditionalists, and also so freaking smart that we don't confuse ourselves 
with the reference.

Those in the 51st state do sometimes get a little snarky about it.  I think 
they envy our intellect.

Eric Sosman wrote:
> As the old saying goes: In for a penny, in for a hundred new pence.

I wouldn't give a farthing for my chances now.

-- 
Lew
Honi soit qui mal y pense.
0
Reply Lew 2/12/2011 10:55:35 PM

On Sat, 12 Feb 2011 17:43:02 -0500, Eric Sosman
<esosman@ieee-dot-org.invalid> wrote, quoted or indirectly quoted
someone who said :

>> Google results suggests Americans call this "English" measure, which
>> is a confusing name for it given that the English now use metric.[...]
>
>     As the old saying goes: In for a penny, in for a hundred new pence.

Perhaps "US" or "American" is the best name for it. Does anyone else
use it but the Americans?
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/12/2011 11:34:09 PM

On 11-02-12 06:29 PM, Roedy Green wrote:
> On Sat, 12 Feb 2011 19:52:39 +0100, Luuk<Luuk@invalid.lan>  wrote,
> quoted or indirectly quoted someone who said :
>
>> o, its just Americans.. than i wont bother and point them to Google
>> (also American) who can do the conversion too.
>>
>> And, THEY, are the expection, at least according to:
>> http://en.wikipedia.org/wiki/International_System_of_Units
>
> I remember doing high voltage transmission line design using
> "imperial" units of measure. How dangerous!  Even back then in the
> days of punch cards, I tried to talk my boss into letting me do all
> calculations internally in metric and convert only for i/o.
>
> I figured FORTRAN needed a "units of measure" feature so it could
> handle the conversions for you safely, and check the dimensionality of
> each statement.  Now that Canadian engineers use metric, the need is
> not so pressing. There is supposed to be an evolved Java called
> Fortress coming with engineering features.
[ SNIP ]

The current reference implementation of Fortress runs on a 1.6 JVM, if 
I'm not mistaken. But it isn't an evolved Java at all - it's influenced 
by Fortran, Scala and Haskell.

As for units of measure in code, there _are_ options already. It looks 
like the JSR-275 stuff ended up at 
http://code.google.com/p/unitsofmeasure/; JScience also has/is/was an 
implementation of JSR-275. Personally I like the way F# does it better, 
but the fact is, there has been some level of support for units, in 
Java, for some years now.

AHS

-- 
We must recognize the chief characteristic of the modern era - a 
permanent state of what I call violent peace.
-- James D. Watkins
0
Reply Arved 2/12/2011 11:34:10 PM

On Sat, 12 Feb 2011 17:33:12 -0500, Lew <noone@lewscanon.com> wrote,
quoted or indirectly quoted someone who said :

>Really, duodecimal is better anyway.

Base 12 has the advantage you can split it evenly so many ways, nice
for sharing buns.  I'm surprised it took so long for a culture to
adopt base 16.  I suspect many people now think of colours as their
rrggbb hex numbers. There was a hint of it early on with quasi-binary
beer measure. That lends credence to Lew's theory you need a degraded
mind to adopt a "simplified" measure.

2 Pints = 1 quart.

4 Quarts = 1 gallon.

9 Gallons = 1 firkin.

2 Firkins = 1 kilderkin.

2 Kilderkins = 1 barrel

3 kilderkins = 1 hogshead.

2 hogsheads  = 1 butt.

Hmm, how to pull this back to Java.

A simple Java coding problem for newbies is to normalize a beer
measure.

e.g. 9 quarts and 2 pints of beer is 2 gallons and two quarts.

It is similar to the coin problem -- working out the minimal bill/coin
set to pay $1.49.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/12/2011 11:49:20 PM

Roedy Green wrote:
> Base 12 has the advantage you can split it evenly so many ways, nice
> for sharing buns.  I'm surprised it took so long for a culture to

AND oddly!  Since three is a divisor, and so is four, you have a much better 
chance of sharing buns than with base 10, where you have to go to five people 
if you have more than two.

If you have to share a dozen buns from Dunkin', it helps if you're already in 
base 12.

The Babylonians were the smartest.  They used base 60.  That also has five as 
a divisor.

> adopt base 16.  I suspect many people now think of colours as their
> rrggbb hex numbers. There was a hint of it early on with quasi-binary
> beer measure. That lends credence to Lew's theory you need a degraded
> mind to adopt a "simplified" measure.
>
> 2 Pints = 1 quart.
>
> 4 Quarts = 1 gallon.
>
> 9 Gallons = 1 firkin.
>
> 2 Firkins = 1 kilderkin.
>
> 2 Kilderkins = 1 barrel
>
> 3 kilderkins = 1 hogshead.
>
> 2 hogsheads  = 1 butt.
>
> Hmm, how to pull this back to Java.
>
> A simple Java coding problem for newbies is to normalize a beer
> measure.
>
> e.g. 9 quarts and 2 pints of beer is 2 gallons and two quarts.
>
> It is similar to the coin problem -- working out the minimal bill/coin
> set to pay $1.49.

That is an excellent suggestion for a programming exercise.

And I was, of course, kidding before.

But really, if base 10 is so great, why do we have 12-hour clocks and 24-hour 
days, 60-minute hours and 6-second minutes, hm?

Shouldn't we have ten "hours" a day of 100 "minutes" each, with 100 "seconds" 
per "minute"?  The new "decimal second" would be .864 times as long as the old 
complicated second, allowing for more precise time measurements.

And we should make the year 1000 days long, too.  And move everyone who likes 
that system to Mars, where it'll make sense.

OK, you're right.  I'm still kidding.

:-), ok?

-- 
Lew
Honi soit qui mal y pense.
0
Reply Lew 2/13/2011 12:04:16 AM

Lew wrote:
> But really, if base 10 is so great, why do we have 12-hour clocks and 24-hour
> days, 60-minute hours and 6-second minutes, hm?
>

six*ty*-second minutes - sticky key.

-- 
Lew
Honi soit qui mal y pense.
0
Reply Lew 2/13/2011 12:05:28 AM

On 2/12/2011 6:34 PM, Roedy Green wrote:
> On Sat, 12 Feb 2011 17:43:02 -0500, Eric Sosman
> <esosman@ieee-dot-org.invalid>  wrote, quoted or indirectly quoted
> someone who said :
>
>>> Google results suggests Americans call this "English" measure, which
>>> is a confusing name for it given that the English now use metric.[...]
>>
>>      As the old saying goes: In for a penny, in for a hundred new pence.
>
> Perhaps "US" or "American" is the best name for it. Does anyone else
> use it but the Americans?

     No.  But that's no matter: A lot of terminology sticks around
long after its origins have dwindled into obsolescence.  Like "core,"
for example, or "dial," or solid-state "disk."

     Or "English," a language spoken only in the USA.  [Dons asbestos
raincoat, er, MacIntosh]

-- 
Eric Sosman
esosman@ieee-dot-org.invalid
0
Reply Eric 2/13/2011 1:56:17 AM

On Mon, 14 Feb 2011 07:50:53 -0500, Eric Sosman
<esosman@ieee-dot-org.invalid> wrote, quoted or indirectly quoted
someone who said :

>>> with a big dollop of Knuth and literal programming.
>
>     As opposed to figurative programming?

oops.  LITERATE programming.  My fingers again. They love to type
completely unrelated words to the ones I am thinking so long as they
begin with the same few letters.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/18/2011 8:46:51 AM

On Sat, 12 Feb 2011 19:04:16 -0500, Lew <noone@lewscanon.com> wrote,
quoted or indirectly quoted someone who said :

>Shouldn't we have ten "hours" a day of 100 "minutes" each, with 100 "seconds" 
>per "minute"?  The new "decimal second" would be .864 times as long as the old 
>complicated second, allowing for more precise time measurements.

During the French revolution, metric was born.  I presume there would
have been some calendar/time simplification too that did not catch on.

With time, we have the solar day, the lunar month and solar year all
of which impose their own eccentricity.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/18/2011 8:50:26 AM

On Tue, 15 Feb 2011 10:19:49 +0000, Nigel Wade <nmw-news@ion.le.ac.uk>
wrote, quoted or indirectly quoted someone who said :

>Do you need a handheld one?

Perhaps a screen one would be ok if it would behave better than a
typical window about covering and covering up.

Usually anything like that keeps getting buried, or won't get out the
way temporarily.

The problem with a handheld one is I usually have to arrange extra
light to use it, and the LCD screen requires just the right angle to
read it well.  Also the segment display is not as clear as it could be
on screen.

A screen one in theory could be configurable. You could select just
the hex functions and get everything else out the way.

The advantage of a screen one I wrote myself is I could put any
functionality into it I wanted, even something specialised like colour
selection, or inter conversion between hex and decimal rgb.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/18/2011 9:03:23 AM

On Tue, 15 Feb 2011 08:21:04 -0800 (PST), Paul Cager
<paul.cager@googlemail.com> wrote, quoted or indirectly quoted someone
who said :

>Building materials are _always_ sold in metric units. A popular size
>for wooden boards, for example, is 1220mm by 607mm (which just happens
>to be exactly 4 foot by 2 foot).

LOL.

I should not laugh though. In Canada, beer and soft drinks comes in
355 ml cans, though big bottles are 2 litres.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/18/2011 9:06:42 AM

On Wed, 16 Feb 2011 12:57:03 -0800 (PST), Lew <lew@lewscanon.com>
wrote, quoted or indirectly quoted someone who said :


>A popular lumber dimension in the U.S. is an eight-foot 2x4 that is 92
>5/8 inches of wood that is 1 1/2" by 3 1/2" in cross section.

I remember being distressed about that when I was a child.  Dad
explained that you COULD buy unsanded lumber that was the true
dimension. I was skeptical that that much wood needed to be sanded
off.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/18/2011 9:09:08 AM

On Feb 18, 4:03=A0am, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> On Tue, 15 Feb 2011 10:19:49 +0000, Nigel Wade <nmw-n...@ion.le.ac.uk>
> wrote, quoted or indirectly quoted someone who said :
>
> >Do you need a handheld one?
>
> Perhaps a screen one would be ok if it would behave better than a
> typical window about covering and covering up.
>
> Usually anything like that keeps getting buried, or won't get out the
> way temporarily.
>
> The problem with a handheld one is I usually have to arrange extra
> light to use it, and the LCD screen requires just the right angle to
> read it well. =A0Also the segment display is not as clear as it could be
> on screen.
>
> A screen one in theory could be configurable. You could select just
> the hex functions and get everything else out the way.
>
> The advantage of a screen one I wrote myself is I could put any
> functionality into it I wanted, even something specialised like colour
> selection, or inter conversion between hex and decimal rgb.
>
> --
> Roedy Green Canadian Mind Productshttp://mindprod.com
> Refactor early. If you procrastinate, you will have
> even more code to adjust based on the faulty design.
> .

MS Windows comes with a calculator with a scientific option.  The most
obvious problem (unless they've rewritten it for Windows 7?) is that
it's not customizeable, so you can't for instance use it as an
embedded window or minimize it to the notification area.

I downloaded a free calculator program years ago from MoffSoft which
does what the old calculator does (the kind you plug in that has paper
running through it).  It doesn't have scientific options (or didn't
when I tested it) but it keeps track of calculations, lets you save
history to file or print, and can minimize to notification area.

Of course if you have time to write your own programs it's always
better since you can add any option the language can handle.
0
Reply Eric 2/18/2011 4:41:20 PM

On 12-02-11 06:08, Roedy Green wrote:
> My venerable solar programmer calculator Sharp El-545 is on its last
> legs.  What do you use for a hand held programmer calculator? Mostly I
> would like it to convert hex <-> decimal and do trig functions.
> 
> Perhaps one that could do conversion of units, metric <-> imperial.

or, you could buy a new one:
http://tinyurl.com/4z7b5gr

-- 
Luuk
0
Reply Luuk 2/18/2011 4:57:48 PM

On Fri, 18 Feb 2011 01:03:23 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>The advantage of a screen one I wrote myself is I could put any
>functionality into it I wanted, even something specialised like colour
>selection, or inter conversion between hex and decimal rgb.

An undo/redo button would be easy to add to peel off incorrect
keystrokes.  That would save quite a bit of starting over from
scratch, and let you verify your previous work.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/19/2011 8:32:25 AM

On Fri, 18 Feb 2011 08:41:20 -0800 (PST), Eric
<e.d.programmer@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>Of course if you have time to write your own programs it's always
>better since you can add any option the language can handle.

One of the fun things would be to allow you two write plug-ins for it
so that you could add functionality without having to understand how
the entire calculator worked.

I am amazed at how cheap hand-held calculators are now. Some
programmable calculators are now available for $2 that once cost
hundreds of dollars.

When you write a calculator in Java, so long as double precision is
sufficient, the code behind any button is just a few lines.

You could also have a "paper" trail, that you can scroll over. 

A project like this becomes a black hole for time, because you can
always think of one more improvement. These is no natural stopping
point.

I wonder if the Desktop features give you a way to globally trap
keystrokes so you could hide/reveal the calculator at a time with a
keystroke.  I wish I had that feature with the Miopixel ruler.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/19/2011 8:41:49 AM

On Fri, 18 Feb 2011 17:57:48 +0100, Luuk <Luuk@invalid.lan> wrote,
quoted or indirectly quoted someone who said :

>or, you could buy a new one:
>http://tinyurl.com/4z7b5gr

that one does not do hex, but its slightly bigger brother the TI-36X
looks just about perfect. See
http://mindprod.com/jgloss/calculator.html

TI has all its manuals online now.  This makes it SO much easier to
get the right model.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/19/2011 9:46:31 AM

On Sat, 19 Feb 2011 01:46:31 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>that one does not do hex, but its slightly bigger brother the TI-36X
>looks just about perfect. See

There are 10 used ones on ebay for $9 each
http://cgi.ebay.com/TEXAS-INSTRUMENTS-TI-36X-Solar-Scientific-Calculator-/330531357545
free shipping in the USA.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Refactor early. If you procrastinate, you will have
even more code to adjust based on the faulty design.
..

0
Reply Roedy 2/19/2011 10:35:02 AM

On 2/12/2011 10:43 AM, Roedy Green wrote:
> On Sat, 12 Feb 2011 10:39:26 +0100, Luuk<Luuk@invalid.lan>  wrote,
> quoted or indirectly quoted someone who said :
>
>> hmm, imperal, thats what they use in the UK....?
>
> The Brits now use metric.  The Americans still use the old British
> system. I have been calling it "imperial". What do Americans call it?
>
> I have Java macros all over my website to display in both systems.
>
The typical American might not know the difference between Metric and 
Imperial, and if they do, they only differentiate by specifying metric 
or not.

This, of course, is a generalization.

-- 
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
0
Reply Daniel 2/26/2011 6:06:30 PM

27 Replies
441 Views

(page loaded in 0.284 seconds)

Similiar Articles:


















7/22/2012 12:15:57 PM


Reply: