ND1 “Quick Tour”

 

Welcome to ND1. Please take a moment to familiarize yourself with the anatomy of ND1 or ND1 Classic:

Getting to know your new calculator.

Del/Undo

ND1

ND1 Classic

Stack and Graphics Display

Edit line

Enter

Del/Undo

“comma” key

2nd level

2nd level

Tap the Drop (⇓/DROP) key repeatedly, until nothing is displayed. (Or find the (CLEAR) key and clear the stack in one go.)


Your display should look like this now:



Tap “2”, tap Enter, tap “2”, tap Enter.



Tap “+”.



What you just did may surprise you. You first entered the numbers you wanted to add, and then added them.

This is what RPN is about.

In RPN (which stands for “Reverse Polish Notation”), “operands precede operators.” The operator “pops” (takes) its operands from the stack (two, in the case of “+”) and pushes its result(s) back on the stack.


RPN seems counterintuitive to everyone at first. After a few minutes, you’re going to like it. After a few days, you may not want it any other way. The two main advantages of RPN over the usual “algebraic” form of entry are: you save keystrokes, and you see intermediate results as you do calculations. This allows you to do mental sanity checks, as you go along.


Counting keystrokes, it appears we’re worse off so far as we needed 5 keystrokes versus 4 for the sequence you’d type with a “normal” calculator (“2”, “+”, “2”, “=”). It turns out, there’re various short-cuts and RPN will never require more keystrokes than algebraic entry. Try this:

Tap “2”, tap Enter. Tap “2”. (No second Enter.)


Tap “+”.


You saved one keystroke by omitting the second Enter.


Tap Drop to clear the display. (Drop is an “operator” that takes one item from the stack and returns nothing.)


ND1 also supports an algebraic (ALG) mode. You switch to it by tapping rpn on the edit line. The edit line then turns green and shows alg. In this mode, you can tap “2” “+” “2” and you get an Equals (=) key. Use in this mode is straightforward, but see rpn vs. alg for usage notes.


In either mode, ND1 supports algebraic notation, and there’s a specific type for algebraic expressions:

Tap the Expression/Name key, followed by “2”, “+”, “2”


Tap Enter.


Now there’s an “expression” on the stack. In order to see what the numerical result of the expression is, you have to “evaluate” it. You do so with the Eval (eval, EVAL) key.

Tap Eval.



RPN and Evaluation are the two “alien” concepts introduced with RPN calculators.

(And from here on, there won’t be any more such surprises.)


Tap Drop to clear the display.


There’s another way to do this computation:

Tap the edit line. This brings up the normal iOS keyboard.

Tap “2”, “+”, “2”.


Tap Enter.


As you see, there’re two methods to enter text into the edit line:

 Using calculator keys and menus. This method will always append to text already present. Pressing certain keys may have effects other than a printed character. (For example, pressing “+” applies addition to stack operands, rather than print the character “+”. But it will print within an expression.) You can use the Del/Undo key to delete characters backwards.
 Using the iOS keyboard or the Paste function. You can use your finger to move the insertion cursor and you can insert text. What you type will always print, and never result in execution. Any math you type evaluates when you press Enter. Both RPN and ALG entry styles will be understood.


You’ve discovered four ways to compute “2+2” in ND1: using RPN, the “normal” way in ALG mode, using an expression, or tapping an algebraic using the iOS keyboard in RPN mode.

 

Task 1: “2+2”

Drop

Drop

Expression/Name key

Expression/Name key

Eval

Eval

Let’s solve this task with what we now know about RPN.


Tap Drop to clear the display.


Tap “5”, tap Enter.

Tap the 2nd level key and “3” (Classic: “.”). This yields π, which is the 2nd level function of the “three” key.

Tap Enter.


You notice that ‘π’ entered with quotes. This is to preserve pi in its symbolic form.


Tap “+”.


Rather than presenting you with a numerical result, ND1 will compute symbolically, if you’re dealing with expressions.


But, wait, we veered off course! We weren’t supposed to add. This is where undo comes to the rescue.

Tap the Del/Undo (⌫/) key.

The Del/Undo key deletes backwards while editing, and does an Undo when there’s no text in the edit line. Tapping it after an undo, does a Redo.


We need the sine of pi. Where’s the sine key? With over five hundred functions, a key for each function is impossible. Hence, ND1 has “menus” and “soft-keys” which change their functions according to the current menu.

Tap the Menu key.


This pop-up allows you to select a menu. (In Classic mode you see less menus. The ones not displayed here, are available directly from Classic keys.)


Tap Trig.



The previously “empty” (black) keys have assumed functions related to trigonometry now. In Modern mode you have 9 soft-keys, in Classic mode you have 6. You can step through “pages” of functions related to these menus with the → (NEXT) and ← (PREV) keys.


Tap sin (SIN).



Again, because pi was in quotes we get a symbolic result. If we want to see numerical results, we need to evaluate. Let’s do that now.

Tap Eval.


ND1 correctly determines that the sine of pi is zero. (Many calculators tell you it’s something like -2.0676153e-13.)


Instead of finding sin (SIN) in a soft-menu, you could also have typed “sin” (or “SIN”) on the edit line, just like you typed other commands in the warm-up task. Sometimes it’s more convenient to use the menus. Other times, it’s more convenient to keep the current menu and quickly type out a function (whose name you must know).


Continuing on with our calculation, tap “2”, tap “+”.


Tap “*”.



Done. Notice that you typed no parentheses, although this calculation requires them. This savings came at the expense of you doing the calculation out of order, “from the inside out.”


This specific calculation would actually lean itself more toward having been entered as an expression and evaluated. Let’s try that, too.


Tap Drop to clear the display.


Tap the Expression/Name key, “5”, “*”, and for the opening parenthesis: 2nd level, “8” (Classic: “EEX”)



Tap sin (SIN). (That’s the sin (SIN) key, not the word typed out. You could do that too, but this would be more work.)


Notice how the function name is spelled out (with an opening parenthesis appended because “sin” is a function) rather than causing sine to be executed–because you’re in an expression.


Tap 2nd level, “3” (“.”) for pi.

Tap 2nd level, “9” to get the closing parenthesis in Modern mode, or tap into the edit line and get it from the iOS keyboard. (In Classic mode, you’d do Menu, String, NEXT and pick “)” from the respective soft-key, if you needed more than one closing parenthesis.)


Tap “+”, “2”. Stop here.



Tap Enter and notice how both closing parenthesis and quote are appended automatically. Closing off begun parentheses, brackets, quotes, program delimiters always works in this fashion. Exploit this, as it’s a major time-saver (esp. when it comes to complex numbers, vectors, and matrices, as you’ll see).


Tap Eval.



With the RPN method you didn’t have to hunt for parentheses and you saw the result of the sine evaluation. If, by accident, you would have been in Degrees instead of Radian angle mode, you’d probably spot it right away based on the intermediate result.


Both entry methods have their strengths.

 

Task 2: “5 * (sin(π)+2)”

Enough drudgery. Let’s do something fun.


Tap ∿ (PLOT; use 2nd level).

Tap draw (DRAW).


If you have Tips enabled (in the Settings app, under “ND1”) you’ll get a dialog that tells you what you can do while in graph view.


Dismiss this dialog for now.


Drag a single finger over the view and notice what happens. The number pair in parentheses on the line edit are the current coordinates of the first graph.


Singe tap and see those numbers disappear. You just pushed them onto the stack.


Double-tap to go fullscreen.


One-finger-drag some more.


Two-finger-tap now. This takes a screenshot, and pushes it onto the stack.


Now drag with two fingers. This will move the graphs. Pinch, and this will zoom in and out.



Double-tap to come out of fullscreen view.

Tap the Space key (bottom left) to cancel graphic display and return to normal stack display.


Double-tap the stack to see it fullscreen. Your stack should look something like this now:


(You may see more or less digitized points (coordinate pairs), depending how often and when you single-tapped.)

Switch back out of fullscreen mode with a double-tap and tap Drop until the screenshot appears at stack position 1.

Now tap Eval OR tap → (NEXT), and →screen (→LCD).



You’ll see the same graph as before, except this time it’s not “live.” After all, this is just a screenshot (that is, the picture of a graph, not the graph itself).

Double-tap and tap to cancel graphics mode. (If you tap instead of , you keep the screenshot on the stack.)

 

Task 3: Graph a function

Where did the graphs we just plotted come from?


Tap ∿ (PLOT) to see the first page of the Graph menu.


Tap eq→ (RCEQ).


This is the “current equation”, which was used for plotting. Two graphs appeared because it’s a proper equation (with a “=” between two expressions). If it were just one expression, only one graph would appear.


Alright, but where does this equation come from?


Switch over to the database by tapping My Data at the bottom.


Data in ND1 is organized in folders.


You can create as many folders as you wish and give them any name. You may choose to organize your data by project, type of data, date range, etc.


ND1 comes preloaded with a couple of fixed folders (“My Vars” and “Units”) and the rest is example data that you may delete.


Shared folders are available in the Database under Downloadables, and can be downloaded with a single tap.













Tap My Vars.


The entries in a folder each have a name and can have any of the various ND1 data types as their contents. There’s also a provision for a comment associated with the datum.


In this folder, there’s a variable named “eq” which contains an expression. It’s the one you graphed earlier, and then recalled.


eq is one of a handful of special names with a meaning to ND1. It is always the “current equation for graphing.” The comment on this variable, appearing in parentheses, says as much and exists to remind you of its special meaning.


You can add, edit, delete data in these folders, and the folders themselves, using standard iOS use practices. If you know how to use the Contacts app, you know how to work this database.


Let’s create one new variable: Tap Edit, tap Add Entry, give it a secret name and type “my very first” (*do* include the quotes!) in the Definition field. Leave the Comment field empty.


On the calculator side, one folder is the current, active folder.  Let’s see how you access data and switch folders.


Tap ND1 or ND1 (Classic).

Notice that “My Vars”, the default current folder, has been displayed in the top right corner of ND1 all along.


Now, tap the var (VAR) key. This is the “database access” key.



You’ll notice the same names that you saw in the database for the My Vars folder, incl. your very own secret name!

Tap A. Tap B. Tap ∑DAT. Tap eq.

As you see, this recalls the contents of these variables.

Tap your secret name. There it is!



If you are in a different function menu, you still have access to this data.

Tap ∿ (PLOT; use 2nd level).

Type A (just like this, w/o quotes) in the edit line.

Tap Enter.

As you see this recalls the contents of A in My Vars just fine. Tap Drop.

Tap the ⊛ (VAR) key to come back to the current database folder.


The connection to the database is two-way. If you wanted to change the contents of your secret variable you could switch over to the database and do it. But you can also do it in the calculator:

Tap 2nd level, tap ⇩(EDIT). (In Modern mode, the ⇩ is just below the 2nd level function; it’s not the Drop key.)


Position the insertion cursor with your finger right after the word “very” and delete the word using the iOS keyboard’s delete key.

Tap Enter to push the edited string.


To store, the calculator needs to have the contents of your datum in stack position 2, and the name in position 1.

Your secret name is right there on a key before you but if you press it you get the contents, not the name. What to do? (If you typed it on the edit line it would also just recall the contents. Just like A above did.)

Here is a last, very important, concept: you refer to the contents of a datum, by specifying its name. If you want to refer to the name itself, put it in single quotes.


Tap the Expression/Name key, tap your secret key. Tap Enter (or don’t; the next step will work either way).

Tap →var (STO).

Stack positions one and two disappear.

To verify the new contents of your secret variable, tap its key. Tap Drop.


Let’s store a new variable:

Tap 7. Tap Enter.

Type seven (just like this, w/o quotes).



Push Enter.



An unknown, non-evaluable item becomes a name. (*If* “seven” were a pre-existing variable, you would have recalled its contents by typing it without quotes.)

Tap →var (STO).


Note that seven now shows up as a key.


Switch over to the database and see the updated contents of your secret variable and seven appear in the database. Switch back to the calculator.


Now, let’s switch to a different folder.

Tap the var (VAR) key. Before, this brought you to My Vars, now it brings you one level up. The key is smart: if you press it while displaying a functional menu it brings you back to your database folder, but if you’re already displaying that folder, then it moves you to the top-level of the database.

On the top-level, you slip into a folder by tapping its name. Let’s slip into Stocks.

Tap Stocks.



Notice how the current database folder name, indicated in the top right, changed.

Let’s see how our favorite computer company is doing today on the stock market. Tap the Apple logo.


Your number will vary. Because, we didn’t recall a stored value. We executed a very small RPL program that called a JavaScript function that went out to Google Finance and obtained a real-time quote for Apple’s stock.


 

Task 4: Try the database



We skip explanations at the beginning and introduce concepts as we go along. Please do the tour sequentially and don’t skip tasks, or you might miss a concept.


Assuming you’re coming from the demo, please do the following now: tap var (Classic: VAR), tap My Vars 


Make sure you have a blue Edit line. If it’s green, you’re in ALG mode. If so, tap alg to switch back to rpn mode.

(ALG mode is not covered here. Please see the notes under rpn vs. alg for usage info.)

Menu

Menu

pdf (10/18/13)http://naivedesign.com/docs/ND1_Quick_Tour.pdf

Tap the Edit line, and use the iOS keyboard to type “scribble” (w/o quotes):



Now tap the Enter (, ENTER) key.

You’ve just entered a command which makes your calculator rapidly draw randomly curved, “glowing” lines which fade into the background:



Tap the display (or tap Done) to dismiss the keyboard.


Double-tap the display to make it go fullscreen:


Double-tapping the Stack and Graphics Display toggles between normal and fullscreen display.


You’re looking at something that’s exceptional for a “calculator”, yet quite easily accomplished in ND1.


ND1 was created to be a modern day update of high-end HP RPN calculators, to which it remains very compatible.

  It builds on the “true and tried” HP calculator model–and operates basically identically–while adding deep new features.


As far as we know, ND1 is the world’s first commercial JavaScript-programmable calculator. What you’re looking at is the result of running a small (~30 lines of code) JavaScript program. Programs thousands of lines long can be run.


ND1 has sharing features that enable developers to create new features and capabilities, and share them with users. Some are already available for download.


Two-finger-tap the screen once. This will take a screenshot.

Double-tap again, to go back to normal display.

Now tap the key at the bottom-left, to end graphics mode.


Supposing you two-finger-tapped to take a screenshot, your screen should now look something like this


(If you two-finger-tapped more than once, you’ll see more screenshots.)


The screenshot was “pushed” onto the stack.

The area which shows the inputs and outputs of operations is called “stack.”  Stack “items” (or “entries”) appear in numbered positions. The stack grows as you “push” items onto it from the bottom with the Enter key.
(With ND1 there’s no limit to the number of items you can push. With ND0, you can only push three items.)


Let’s push a number onto the stack:

Type “56”



and tap Enter



Commands (which we will also call “functions” or “operators”) operate on the bottom entry (or entries, if they take more than one input) of the stack and replace their inputs with their outputs (=results). The “scribble” command above took no inputs and produced no output. Most mathematical functions, however, do.


Let’s try a mathematical function that does something with our number and returns a result.

Type “divs”



Tap Enter



The command “divs” computes the divisors of a given number. Since there can be more than one result, the overall result is returned as a list (or “vector”, “array”) of numbers, in our case the numbers 1, 2, 4, 7, 8, 14, 28, and 56.


Besides numbers and vectors, ND1 supports a variety of data types, including “exotic” ones, like screenshot.


Just like there are commands that work with numbers, there are those that operate on vectors. Or screenshots.

Oftentimes, the same command can operate on varying data types, with sometimes quite different effects.


Let’s do the “divs” command again and see what it does to a vector. Instead of typing in “divs”, you can obtain the last command performed by tapping the 2nd level key, followed by the Enter key (Classic: the “7” key). Do this now.

It should yield



Tap Enter



Run on a vector, “divs” computes the divisors for each “element” in the vector (in our case, each previous divisor). So, you’re ending up with result vectors inside a vector. (This is also called a “multi-dimensional array” and one of ND1’s specialities is that it can deal with them, hold any kind of type, and that there’s no limit to the dimensionality.)


To see the obscured part of the result, flick through the stack with your finger. (And note that once you start to drag, you can use the full height of your device to “pull” the stack. You can drag right over the ND1 keys.)


Or, double-tap the display to go fullscreen.



Speaking of keys: you can hide the tabs to get larger keys and a bigger display.

To hide the tabs, tap the ND1 (or ND0) button when it’s already selected.
To fade in the tabs again, tap the Menu key. To keep the tabs visible, tap ND1 while faded-in.


The wealth of data types, and functions that can operate on those types, is what makes this calculator, and similar ones, “high-end.”

  You’ll find that ND1 supports an unsurpassed array of data types. It also has a unique ability for developers to create new types. The amount of built-in functions is high, but the best hardware calculators from other brands support many that ND1 doesn’t support. (The HP-50g has code libraries with thousands of programs, for example.)

It is for this reason, that ND1 also supports programmability in RPL (the main HP calculator programming language). This enables it to tap into classic code libraries.

  RPL and JavaScript can be used interchangeably, and the aspiration for ND1 is to offer an amazing platform for calculator programming.


To close our warming-up session, try one really useful command. (Just after double-tapping the screen again to return to normal display.)

Type “email”:



This brings up the standard iOS email screen, with your stack as email body.




Your stack may show a log of your calculations, graphs of functions you plotted, intermediate results of lengthly calculations, results you want to keep, etc.


So, it comes handy being able to email it.


Note that your screenshot displays full-size now. You can take screenshots of anything shown in graphics mode. You can email yourself full-screen graphs (we’re coming to graphing in a moment) and print them from your computer.


Also note that you can edit this email. You can place the cursor between stack lines and annotate them, for example.









Tap Cancel now, or go ahead and Send this first stack email to yourself.


Great. You learned how to use the standard keyboard to type and issue commands. You learned some stack basics, how to toggle display modes, take screenshots, end graphics mode, hide/unhide the tabs, and email your stack.


Now, let’s backtrack and see how to do what calculators are really meant to do: calculate.


(If you’re familiar with HP calculators, you may skip the following tasks 1 and 2, but please read the green boxes.)

 

Task 0: Warming up

tabs