50. Is there a way to predict how much memory a program will take up?

I recently began to wonder if there was an easy relationship between the size of the program on the computer (in bytes) and the size of the program after it is transferred to the 38G and run (for those who don't know, the first time you run a program an additional copy is created in machine language - that's why it's slow the first time but fast after that).

I checked for the programs I had done up to that point and found (to my surprise) that there was a VERY clear relationship - I was expecting some linkage but not so strong as I found.  A rough rule is:  "Whatever the sizeon the PC, triple it and add 30 to get the size on the 38G".  Since you only have (approx.) 23500 bytes available then this will help you keep track of how many more you can fit in.

If you're interested - the relationship is  y = 2.936x + 33.137, where x is the number of bytes on the PC and y is the number on the 38G.  This had a correlation of 0.9938, which is very high.
 
 
 

51. Is it possible to convert to other number bases on the the 38/39G? In particular, binary and hexadecimal?

Question:  I'm a sci/eng student from UWA, and was wondering if there were any programs/ApLets available which allow you to work with numbers of different bases. Unlike most other scientific calculators, the 38G seems to have forgotten about base conversions. In engineering, where converting between decimal, binary and hexadecimal numbers is essential, it would be extremely handy to have a function on the calculator to do it for me!!  Any advice or direction would be appreciated :).
Question submitted by:   Various people over the past 2 years.

Answer:  I agree that it's a pity that they didn't include a function for it in the MATH menu.  I wrote two programs which convert from any base to 10 and from 10 to any base respectively.  Click here to download them.  Note that they are programs not aplets - they must be downloaded using the Connectivity Kit into the Program Catalogue not into the LIBrary.  If you don't have the Connectivity Kit and have to type it in yourself, then you can find the two programs displayed as images here along with a large collection of other small programs.
 
 

52. How can I transfer the fit equation from the 2VAR Statistics PLOT view to the Function aplet?

Answer:  (Courtesy of Mark Howell)  Once you have found the equation of the line (or curve) of best fit in the PLOT view of the 2VAR Statistics aplet, it is sometimes desirable to be able to transfer the equation found to the Function aplet.  Of course you can always type it in by hand but there is an easier way.  Just go to F1(X) and enter the equation PREDY(X).  Now move the highlight back to F1(X) and press EVAL.  The equation will appear.
 

53. How can I transfer data from columns or lists on the 38G to a PC so that it can be used in Excel or some other application?

Answer: The problem is that when you use the Connectivity software to transfer an aplet or a list (or a matrix) to a PC the result is stored in binary (1s and 0s).  This is not readable by any other application, such as a spreadsheet. Nor is it in a form that is readable by you!  The trick to transfering the data in a readable form is to use the only 38G object which is NOT stored in binary - a program.

Suppose you have some data which is stored in C1 of the Statistics aplet and you want to transfer it to a PC and paste it into an Excel spreadsheet.  The first step is to transfer the data into a program.  Make sure in the LIB view that the Statistics aplet is the active one.

Go to the Program Catalogue view and create a NEW program called DataStore (or whatever else you wish). When you create it you will find that you will be EDITing the program.
.
.
Press VAR and then press the second screen key (SK2) labelled APLET to get access to the aplet variables.

Now press VALUE (SK4) so that the contents of C1 transfer instead of just the name.  You may have problems at this point due to lack of memory since the data is now appearing in two places, C1 and the program.  If this happens there is not really much you can do to fix the problem.
.
.

This process will paste the set of numbers from C1 into the program as a list variable enclosed in curly brackets.

Now use the Connectivity software to transfer the program to a directory on the PC.  The result can be seen on the left. The file you want is the one labelled DATASTOR.000  We need to open this file in Excel.  Start Excel and use the File -> Open command.  You will need to change the file matching criteria (see below right) so that the window shows 'All files' otherwise the file you want will not be visible.
.
.
.
.

When you open the file Excel will run its "Text Import Wizard".  In the first step you need to tell it that the data is 'Delimited' rather than 'Fixed width'.  In the second step you need to specify that the delimiting character is a comma (see left).  As you can see, there are a few extra characters which cause problems for the first number but they can be edited out later.
.
.

Once you have pasted the data into Excel you will find that it has been imported as a row.  This is not always convenient and you may wish to change this to a column. To do this just highlight the row of data and Edit -> Copy it.  Reposition the cursor to the cell where you would like the column to start.  Now do an Edit ->Paste Special.  In the box which pops up you need to tick the box labelled 'Transpose' (see right).

.
.

Similar methods can be used to get data from the PC back onto the 38G.  The process starts similarly to the above, except that the data in C1 should be just a couple of values which are only there to space things out.  Transfer the program to the PC.

Meanwhile you need to save the Excel data in a special format called CSV, which stands for "comma separated".  Once this has been done you can exit from Excel and open the CSV file in Notepad.  Highlight the data, which should be separated by commas and use the Edit -> Copy command to transfer it to the clipboard.

Now use Windows Notepad to open and edit the file you transfered from the 38G.  DO NOT use any other editor as it will damage the file. Remove the dummy data, leaving the curly brackets in place.  Paste the data from the CSV file into this position.  Check carefully to ensure that the format of the list is correct for the 38G.

Transfer the program back to the 38G.  EDIT the program and, at the end of the list of data, put a STO character and C1.  This means that the program now contains a command to STO the data into C1.  RUN the program and check that it has successfully transfered.  Delete the program to save memory.
 
 
 

54. How can I edit HP39G notes using the ADK?

Answer: Very easily (as of May 2002) if you get the HP39G version of the ADK, called ADK39.  Just go to my Utilities page and download the file. If you don't yet have the Connectivity kit then you can download both it and ADK39 in one package. Otherwise scroll down until you find the ADK39 and download just that.
 

55. My calculator has locked up and I have important data on it that I don't want to lose.

As calculators become more complex so do their operating systems (the way they 'talk' to you).  The HP38/39/40G series has one of the most complex operating systems around and with greater complexity comes greater flexibility but also, sometimes, a little touch of instability.  Teams of teachers and enthusiasts spend months before the calculators are released trying to crash them by doing the most ridiculous things they can think of, just so that when you do it, the calculator shrugs (metephorically) and says "Ok" rather than locking up and losing your data.  But.... no matter how we try, we still miss some bugs.  As I am writing this I have just sent a message to HP about a bug that I have found in the Solve aplet.  It's not a serious one and I doubt you'd ever find it (I was playing) but there are surely others - we just can't think of every possible thing that users can do.

Note:  If you are using an aplet and strange things have started to happen then click here before continuing.

So what do you do if your calculator has locked up (frozen) and you have important information on it that you don't want to lose?

First:  Learn from this!  The socket at the top of the calculator is there so that you can plug a cable into it and save your precious information onto a computer.  DO IT!  Go out and buy a cable - save your notes, programs and aplets regularly so that you won't worry if this happens again.

Second:  Try these possible remedies, in the order that they appear below.

  • Press the ON button quickly and repeatedly 3 or 4 times.  If the calculator is just 'stuck in a loop' then this may break it out.
  • Do a soft re-boot.  Hold down the ON button and, while holding it down, press and hold screen key 3 (the third one from the left below the screen).  Now release SK3 then ON.  If it works then you should find yourself back in the HOME view.  Normally this process DOES NOT LOSE DATA but if the problem was serious then you may be unlucky.  It does clear the History in the HOME view but this should not be a problem I hope.
  • Do a physical reset.  This involves sticking a pin or a paper clip into the hole on the back of the calculator and pressing down gently.  At the bottom of the hole there is a switch that you can push to trigger the reset.  This option is equivalent to the previous step but works even if the keyboard is locked up. IT MAY LOSE DATA.  The chances are on your side but there are no guarantees.  It's your risk.  The worst that can happen is that you lose the data.
  • The next option is a desperation move if nothing has worked so far.  It will almost certainly cause loss of all data but God might smile upon you.  Do a hard re-boot.  Hold down the ON button and, while holding it down, press and hold screen key 1 and 6 (the first and last of the row below the screen).  Now release first SK6, then SK1, then the ON button.  If it works then you should find yourself looking a screen that says "Memory clear?" with an OK button.  Don't fool yourself - it's not asking you a question: your data is lost.  But at least your calculator is un-frozen.
  • The final option is a last resort and will certainly cause complete loss of data (back to factory settings).  The only reason you should get this far is if there is something fairly seriously wrong.  Take the batteries out and leave them out overnight.  There's a small internal battery that normally preserves data while you change batteries, so you can't put them back immediately: you have to wait for this internal battery to run out. I'm not actually sure how long it will last but I would be very surprised if it was capable of lasting more than an hour at the very most.  When you put them back in, use fresh batteries.  Hopefully you'll find that the calculator is back to normal.  If it's not then I hope your warantee is still valid :-).

56. What is 'RelError?'?

The value of RelError is available on both the HP38G and the HP39G but it only appears in the STAT list on the 39G.  On the HP38G you have to type RelErr into the HOME view to get its value.

Suppose that you have a set of bivariate (2VAR) data which is not linear and you have used the SYMB SETUP view to change to an exponential fit. You may have already noticed that the value of the correlation coefficient does not change and so, on the 38G, there seems to be no way to tell numerically whether your change was justified.  The reason for this is that the correlation coefficient is a linear measure and, mathematically, can't be used with other fits.  The value of RelErr is there to compare other curves.  RelErr is defined as the measure of the relative error in predicted values when compared to data values and its formula is given right.

Unlike the correlation coefficient, RelErr is not contrained to a range from zero to 1, with 1 being best.  RelErr has no upper limit and the lower the value of RelErr, the better the fit is considered to be.
 
 

57. How can I get 'nice' values in the table when I use the split view of the Plot-Table view.

If you use the default scale of -6.5 to 6.5 in the Plot-Table view then you will find that the table values are not at all 'nice' values.  The reason is the pixels taken up by the stripe down the centre of the screen. The answer is to use a scale of -6.4 to 6.4 instead.  In actual fact, any values that are powers of two will work.  For example, a scale of -8 to 8 will give table values going up in steps of 0.25.  See also how to get 'nice' values in the normal PLOT view.
 
 

58. How can I easily display the roots of a polynomial?

The POLYROOT function is an easy way to find the roots of any polynomial, but if the roots are complex or irrational you will find that the dispay in the HOME view is difficult toread.  The simplest way to deal with this is to store the results into a matrix as a vector.  For example, suppose we wish to find the roots of the polynomial x3+8=0.  If we STO the results into M1 then they are easily readable and accessible.
If you now change to the Matrix Catalogue and EDIT matrix M1, you will find the roots displayed.  You can also refer to them on an individual basis in the HOME view by referring to M1(1), M1(2) etc.
 

59. What are "Easter Eggs" and do the HP38G or HP39G have any?

An "Easter Egg" is a small hidden trick that programmers sometimes deliberately leave inside the finished product but which does not appear in the documentation.  Generally it will be triggered by some combination of key strokes that would not normally occur.  The programmers of the HP38G included a couple of these in the machine and those of the HP39G added others.

Some of these are:
 

  • In the HOME view, type RULES and hit ENTER and you will see a crossword giving the list of HP38G programmers.  The same trick works on the HP39G but gives a different list of course.  On the HP39G there is another list that contains the names of all the people who were key contributors but were not direct employees of HP at the time.  To see this list, type AMIGOS.  My name's on there if you look carefully. You can also try typing SYNTAX RULES and SYNTAX AMIGOS.  
  • In the HOME view, type WSLOG.  This gives a view of the warm start log, which is a list of events since the last warm start.  Not of any use normally.
  • There are a number of ON+key combinations that perform various tasks.  To see more information on these, see question #38.
  • If you type SYSEVAL 171591 on the HP38G in HOME and press ENTER then you will see a very odd piece of left over code.  DON'T DO THIS on an HP39G.  When the HP38G was being designed there was originally a plan to have a separate view for independent sketches, just as there is a Notepad Catalogue of independent notes, as well as a note view for notes attached to an aplet.  In the end they decided not to do this, probably due to lack of memory since each sketch consumes 1Kb, but the partially completed code was left in. The soft key labels at the bottom of the screen don't actually do anything except put messages on the screen.  The "Elsie" referred to in these messages was the code name for an HP38G during the construction phase.
  • Typing SYSEVAL 535863 in the HOME view of an HP38G will return the amount of free memory in bytes.  DON'T DO THIS on an HP39G as you will crash the operating system and lose all memory (ie a full factory reset).
  • Typing VERSION in the HOME view will display a box which gives the ROM version.  For an HP38G this should be version A since there was never a revision apart from the update to an HP39G.  For the HP39G the version will also be A.
  • Typing SYSEVAL 260387 in the HOME view of an HP39G or HP40G will run a game called Dynablaster. Typing SYSEVAL 260385 will run the game Tetris. Press DEL to get out of the games.  Both of these are built into the chip as a bit of a secret joke by the programmers.