Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Deep Toaster on May 28, 2010, 06:36:25 pm

Title: Calcalca
Post by: Deep Toaster on May 28, 2010, 06:36:25 pm
I'm pretty sure this hasn't really been done before, at least in TI-BASIC, but if something similar exists, please notify me.

Last year, I was absolutely amazed by the simplicity and ingenuity of Google Calculator, especially where you can type in any expression using any units (and an optional unit to convert to), and I decided that that was something someone needed to code for TI calculators. Thus I went on a coding rage, and actually got much of it done within a month, to the point where you could type in something like 7 M * IN INTO CM CM and it would display 1778. Unfortunately, I couldn't figure out division, parentheses, or exponents, so I set it aside and continued with other projects. One day, I really needed to clear some ARC space, so I deleted the group where I had saved it (I called it CALCALCA). I finally started regretting this decision, and will start coding it again, but I really need help with the issues I mentioned above.

This is what I've decided for the program so far:
1. It will use a blank input (Input "",Str1) to input a continuous expression.
2. The resultant string will searched through first for illegal characters.
3. The string is checked a second time, this time for the characters " INTO " (which specifies that the following units say what unit the user wants)
4. First, "(" is added to the beginning, and ")" to the end, just for padding (i.e., "("+Str1+")"→Str1)
5. The string is then evaluated, one character at a time.
    a. Whenever it hits a space, it tests to see whether * follows it.
        i. If there is one, the space is deleted by using sub('s for the two sides of the string.
        ii. If there is not, the space is replaced with )(, which assumes the space meant implied multiplication.

    b. Whenever it hits a letter, a subloop gets the entire combination of letters, which is saved to another string for checking.
        i. The second string is checked against a database of all the units to be supported (see note below).
        ii. If there is a match, that entire section of the main string is replaced with the numerical value of the unit, surrounded by "(" and ")", and the unit's base units are added to a list (see second note below). matrix.
    c. Whenever it hits a number, ".", "*", or "E", it it added directly.
    d. Whenever it hits a "(", the matrix is widened by one, and base units added from then on are added to the new column.
    e. Whenever it hits a ")", it stored the rightmost column into L1 and checks the following character.
        i. If it is a "-1", L1 is inverted.
        ii. If it is a "2", L1 is doubled.
        iii. If it is a "^", another subloop is used to get the entire number following it, and L1 is multiplied accordingly.
        iv. L1 is integrated into the next-rightmost column of the matrix.

6. When this is all done, the program will evaluate the string (with an exp() and (theoretically) appends the final unit.

Note:
The database consists of a huge (literally, huge, and might even be larger than the program itself) string containing each supported unit in the format:
Code: [Select]
"   2            Pa           -1    01    00    -2             1.00000000           ..."
    ^            ^            |                  |                  ^                ^
    |            |            +------------------+                  |                |
    |            |                     |                            |                |
Length of     Unit name.    These four numbers are the       How many of the      Continue
unit name.                  base units for the unit, in      unit fit into        onto next
                            the order {length, mass,         the base unit.       unit.
                            current, time}. For example,     Since pascals are
                                Pa=N/(m^2)                   the base for
                                =(kg*m/(s^2))/(m^2)          pressure, this
                                =kg/(s^2)/m                  would be a one
                            so is mass (the positive         (the zeroes are
                            one) divided by time squared     because it needs
                            (the negative two) divided by    to have exactly
                            length (the negative one).       ten characters).

Anyone willing to help me with this program? I currently have several programs in development simulataneously, and I can't finish this myself.
By the way, if anyone can't read the above code, I attached it as a .txt:
Title: Re: Calcalca
Post by: meishe91 on May 28, 2010, 07:07:19 pm
I can probably help some, or can try. I'm not exactly for sure what you are trying to do for sure though.

One thing I noticed though is you can just have Input Str1 instead of Input "",Str1.

Actually scratch that. I forgot that it puts a ? there, which I don't see as in issue but ya, I'm not you.
Title: Re: Calcalca
Post by: jsj795 on May 28, 2010, 07:15:39 pm
I'll try to help. I tried to make the BASIC program that gives the derivative using string. Although I didn't finish it, developing it helped me understand a lot about strings and doing math stuff with the string.
But I don't have my calc atm, and will be able to help you after around mid-June.
Title: Re: Calcalca
Post by: Deep Toaster on May 28, 2010, 07:28:45 pm
I can probably help some, or can try. I'm not exactly for sure what you are trying to do for sure though.

One thing I noticed though is you can just have Input Str1 instead of Input "",Str1.

Actually scratch that. I forgot that it puts a ? there, which I don't see as in issue but ya, I'm not you.

Basically, this will be a program, written in pure BASIC, that will do complex unit conversion/calculations. By the time this program is done, I'm hoping that it will accept input such as 5 kg*m2/s2 INTO cal and display the answer as 1.19502868.

Yeah, I will use Input "", Str1 simply because I want it to look as natural as possible, and without the "?", it looks exactly like the main TI-OS homescreen.

I'll try to help. I tried to make the BASIC program that gives the derivative using string. Although I didn't finish it, developing it helped me understand a lot about strings and doing math stuff with the string.
But I don't have my calc atm, and will be able to help you after around mid-June.

Well, that's unfortunate. I can only upload files until mid-June.

Doesn't matter, though. I'll post updates in other ways.

EDIT: Just thought of something: The newest version of WabbitEmu supports exporting variables, right?

EDIT2: Wow, there's a lot more traffic on Omnimaga.
Title: Re: Calcalca
Post by: jsj795 on May 28, 2010, 07:31:20 pm
EDIT: Just thought of something: The newest version of WabbitEmu supports exporting variables, right?
Well, I never used that feature so, I don't know for sure :/
You can post whatever you have until the time you'll be able to upload and I'll try to pick it up from there
Title: Re: Calcalca
Post by: meishe91 on May 28, 2010, 07:44:07 pm
And I'll try to help however I can too.
Title: Re: Calcalca
Post by: Deep Toaster on May 28, 2010, 11:50:52 pm
Thanks!

Anyway, I'm currently working on the data string. Here's an example for the length functions I've included so far:

:"1m  010000001.000000002in 0100000039.37007872ft 010000003.280839902yd 010000001.093613302mi 010000006.21371E-4...

The problem I'm already seeing now is that I have to include 8 characters for the unit combination every time I add another unit, even if it's exactly the same as for the previous few units (in this case, 01000000). If I could get rid of most of them, it would free up a lot of memory, but then it'd be somewhat hard to access the unit type of an individual unit. Can anyone think of better way to do this?

EDIT: Biblical cubits are now supported for the fun of it. :)
Title: Re: Calcalca
Post by: DJ Omnimaga on May 29, 2010, 12:02:40 am
Seems interesting, altough I've been out of hi school (the last time I ever had math classes) since 2003, so I am not into math stuff anymore, so I doubt I would be able to help much. I can't wait what you will come up with this, though, and I hope people can help.

Quote
Well, that's unfortunate. I can only upload files until mid-June.
Do you mean you do not have internet access at home, only at school? I remember when I was in that situation. Very hectic x.x (altough I generally got a lot of free time for programming :P).

Quote
EDIT: Just thought of something: The newest version of WabbitEmu supports exporting variables, right?

Yup. Actually, I heard it did since forever, but it was not documented well. Press F7 while Wabbitemu is not in busy mode. For newer versions of wabbitemu, that menu can be accessed through Right-click->Calculator->Variables, too. Just drag and drop what you want on the computer somewhere.

Quote
EDIT2: Wow, there's a lot more traffic on Omnimaga.
Yeah, activity increased a lot since November, altough it was much higher 6-10 weeks ago, post-wise (I still remember those two 300+ post days). (shortly after Ndless and gbc4nspire came out) It seems traffic increased again, though, because we get a lot of 500 Internal Server Errors lately
Title: Re: Calcalca
Post by: meishe91 on May 29, 2010, 12:19:56 am
If you're still working on this over at UTI and such I'm sure Goose or Thornahawk could help over there. They seem to be very math savvy (10 point word of the day :P).
Title: Re: Calcalca
Post by: Deep Toaster on May 29, 2010, 01:03:20 am
I'm not going to get to the math portion in a few weeks (or months), because I still need to finish a unit database first.

Here's a list of the units I'm definitely going to include (not counting prefixes such as centi- or operations such as 3):

Length: m, in, ft, yd, mi
Area: are, acr
Volume/Capacity: cc, L, foz, gal, bus
Velocity: kn
Mass: g, T, oz, lb, sT, lT
Time: s, min, hr, day, yr
Frequency: Hz
Force: N
Work/Energy: J, cal, Cal
Power: W, hp
Current: A
Charge: C
Voltage: V
Resistance: ohm
Pressure: Pa

What do you think? What else should I include?
Title: Re: Calcalca
Post by: meishe91 on May 29, 2010, 01:05:53 am
For mass I would change g to kg, well that's just me since I'm a physics guy.
Title: Re: Calcalca
Post by: Deep Toaster on May 29, 2010, 01:13:34 am
For mass I would change g to kg, well that's just me since I'm a physics guy.

I'm documenting only the base values because prefixes like kilo- will be dealt with in a different way.
Title: Re: Calcalca
Post by: meishe91 on May 29, 2010, 01:17:57 am
Oh ok, sorry I missed that from earlier. I'm very tired.
Title: Re: Calcalca
Post by: DJ Omnimaga on May 29, 2010, 01:22:05 am
Isn't there also m3 for volume? (cube meter)

That's what we often used in physics classes over here besides liters
Title: Re: Calcalca
Post by: Deep Toaster on May 29, 2010, 01:25:03 am
Isn't there also m3 for volume? (cube meter)

That's what we often used in physics classes over here besides liters

I'm also treating operations (all operations, not just exponents) separately.

Actually, that's the part that stumped me when I first made this program a year ago. I could get multiplication and implied multiplication working fine, but not division, exponents, or parentheses. Do you think I should just simplify things by including squares and cubes as units on their own?
Title: Re: Calcalca
Post by: DJ Omnimaga on May 29, 2010, 02:01:14 am
Aaaah ok. I guess maybe it would be better to include them on their own, then.
Title: Re: Calcalca
Post by: Deep Toaster on May 29, 2010, 02:23:02 am
By the way, does anyone know of a PEMDAS-style evaluator in BASIC? It'd be really helpful for me when I add the operators.
Title: Re: Calcalca
Post by: jsj795 on May 29, 2010, 12:46:08 pm
Isn't there also m3 for volume? (cube meter)

That's what we often used in physics classes over here besides liters

I'm also treating operations (all operations, not just exponents) separately.

Actually, that's the part that stumped me when I first made this program a year ago. I could get multiplication and implied multiplication working fine, but not division, exponents, or parentheses. Do you think I should just simplify things by including squares and cubes as units on their own?

What I did with exponents is that for 2 and 3 or any kind of roots, I would change them to "^2" or "^3" or "^(1/2)" etc.
If I had your program and my calculator, I would be able to help you more... I don't know exactly how your program works
Title: Re: Calcalca
Post by: Quigibo on May 29, 2010, 01:25:10 pm
I made a program that does all of these conversions in the same way and a whole lot more other features that I used for chemistry.  I can show you the source code if you'd like, I never released it.
Title: Re: Calcalca
Post by: meishe91 on May 29, 2010, 02:15:12 pm
I made a program that does all of these conversions in the same way and a whole lot more other features that I used for chemistry.  I can show you the source code if you'd like, I never released it.

So you already made a program like this?

By the way, does anyone know of a PEMDAS-style evaluator in BASIC? It'd be really helpful for me when I add the operators.

Doesn't the calculator already do this by default?
Title: Re: Calcalca
Post by: Deep Toaster on May 31, 2010, 11:26:03 am
I made a program that does all of these conversions in the same way and a whole lot more other features that I used for chemistry.  I can show you the source code if you'd like, I never released it.

Sure. How much memory does it take up, just for reference?

By the way, does anyone know of a PEMDAS-style evaluator in BASIC? It'd be really helpful for me when I add the operators.

Doesn't the calculator already do this by default?

Yeah, but I wanted to see a BASIC program for the source code.

Good point, though. Probably no one would bother to make another one.

EDIT:
(I know I'm quoting myself here, but I'm too lazy to type it all out.)
Unfortunately, I couldn't figure out division, parentheses, or exponents, so I set it aside and continued with other projects. One day, I really needed to clear some ARC space, so I deleted the group where I had saved it (I called it CALCALCA). I finally started regretting this decision, and will start coding it again, but I really need help with the issues I mentioned above.

Never mind! The operations turned out easier than I thought, or at least easier than it seemed last year.

Thanks for offering your help, though!

UPDATE: Division, exponents, and 2/-1 all work! If all goes well, I can get the final version of this program at least onto my thumb drive by the end of the school year. :)

EDIT2: Wow, this is the first time xor has ever been useful to me.

UPDATE2: Now it supports all of the units listed above (http://ourl.ca/5948/92107), with all SI prefixes from yocto to Yotta (http://en.wikipedia.org/wiki/SI_prefix#List_of_SI_prefixes). Anyone think I'm overdoing this?

This is DEEP THOUGHT'S 42nd post!
Title: Re: Calcalca
Post by: DJ Omnimaga on May 31, 2010, 12:59:52 pm
Nice to see more progress :)

Title: Re: Calcalca
Post by: ztrumpet on May 31, 2010, 01:07:44 pm
Wow, this is the first time xor has ever been useful to me.
Nice! ;D
I'm glad you're over here, Deep Thought!  I'd like to mention that I thought Insanity was great.  Nice job on it. :D

This looks pretty cool.  Good luck on it! :)
Title: Re: Calcalca
Post by: Deep Toaster on June 01, 2010, 07:21:01 pm
Thanks for all the support!

UPDATE: And it's done!

*beta program would have been here if TI-Connect had been working*

TI-Connect isn't working ... again. I've uninstalled and reinstalled it twice in the past hour already, and it still doesn't work. When I plug in a TI-84 Plus via a direct USB cable, it starts installing driver software, but TI-Connect doesn't recognize it. I also tried TiLP (twice also), but as soon as I open it up after installing the program, it displays a message that says it's missing some kind of "entry point" in the .dll file. Anyone have any idea what's going on here? I'm using Windows Vista, by the way.

I would have transferred the programs on the school iMac (and downloaded Axe), but for some reason my thumb drive didn't get recognized. All in all, I'm just having a horrible day with all the computers I've been using failing on me.
Title: Re: Calcalca
Post by: DJ Omnimaga on June 01, 2010, 08:22:13 pm
You might want to ask this question in a separate thread as it might get missed by some users who come to help.

Glad to see progress, though
Title: Re: Calcalca
Post by: meishe91 on June 01, 2010, 10:56:08 pm
What exactly was happening? (With TI-Connect.)
From what it sounds you were plugging the USB and the calculator into that and it won't just get recognized, right?
Title: Re: Calcalca
Post by: Deep Toaster on June 02, 2010, 12:04:53 am
What exactly was happening? (With TI-Connect.)
From what it sounds you were plugging the USB and the calculator into that and it won't just get recognized, right?

Yeah, that's about it. It was recognized by the driver installer, but not by TI-Connect.

Might just be the calculator. I was using a friend's TI-84 Plus which had been buggy (in calc-to-comp connections) in the past, while I've also used a TI-84 Plus Silver Edition that worked perfectly.

You might want to ask this question in a separate thread as it might get missed by some users who come to help.

Glad to see progress, though

I'll do that if I later if I still can't get it to work.

And I know it's been a while since this post was made, but:
Quote
Well, that's unfortunate. I can only upload files until mid-June.
Do you mean you do not have internet access at home, only at school? I remember when I was in that situation. Very hectic x.x (altough I generally got a lot of free time for programming :P).

Well, not exactly; there are other reasons. But here's a perfect example why I'd prefer to transfer programs at school even if I could do it at home.
Title: Re: Calcalca
Post by: meishe91 on June 02, 2010, 12:19:23 am
Well it could also be the USB slot to. I know I have trouble with a couple of mine on my computer so you could just try switching where the cable is plugged in to see if that works.
Title: Re: Calcalca
Post by: Deep Toaster on June 02, 2010, 06:54:01 pm
Well it could also be the USB slot to. I know I have trouble with a couple of mine on my computer so you could just try switching where the cable is plugged in to see if that works.

Tried that, still didn't work. :(

Anyway, TI-Connect at school works (I love Macs :D), so here's a version of my program. It comes as a group with two programs: CALCALCA (the main program) and LOW (an ASM subroutine to allow lowercase).

When you run prgmCALCALCA, nothing seems to happen, and the calculator still seems to be at the homescreen. It's actually already in the program; the blank screen is from the Input "",Str1. The program leaves most of the calculation intact, so if you type in a normal expression (such as 1+1), it'll just display the answer (with expr(Str1. The key is that the program checks for the string "_into_ or " INTO (notice the spaces), and if it's found within the input, it goes into evaluation mode.

Syntax for evaluation is [expression] into [unit] or [expression] INTO [unit] (again, notice the spaces). Other spaces are ignored by the evaluator, so you could type 5 N m into ft lb or 5Nm into ft*lb, and it would display the same answer. This is so that input is more natural and easier to read. However, the program is actually looping through each character in the string input, so the shorter the input, the faster the program can evaluate it.

If the units are mismatched on the two sides of the input, the programs throws an ERR:MISMATCH, but I have yet to add the other error messages (e.g., for unrecognized units).

I haven't compiled a list of supported units left, but in case you're wondering, they're all in Str1 (after you run the program at least once). Just look for the alpha characters. By the way, the program is case sensitive, so mPa is millipascals, while MPa is megapascals. Do not put an extra s at the end of a unit, even for a unit such as lb.

All SI prefixes from yocto to Yotta are supported, except for milli- and Tera- on three-character base units (such as cal, acr, and are), as well as millitonnes (who would ever use that?). All units must be abbreviated. Thus, 5 amperes2*6 ohms INTO milliwatts will not work, while 5 A2*6 ohm INTO mW will.

Addition, subtraction, and functions are not supported, and probably never will be, but since they are simply skipped over by the evaluator, 8 J into ft-lb will be read as "8 (J)" into "(ft)(lb)". Unlimited numbers of parentheses, division, exponentiation (including 2, 3, and -1), and multiplication (duh) are supported.

I know, the program still runs pretty slowly. I'll still have to optimize some things. Until then, everyone is allowed (and encouraged) to look into the code, and suggestions are (very) welcome.

EDIT: Next time I post an update, I'll probably also include an easter egg ... or two. :)

EDIT2: Conditions remarked on in previous statement achieved here (http://ourl.ca/5948/93003).
Title: Re: Calcalca
Post by: DJ Omnimaga on June 03, 2010, 01:26:43 am
Nice to see this out. Sadly I doubt I'll have time to test anything for a long while, though, because I have a lot of stuff to do soon :(
Title: Re: Calcalca
Post by: meishe91 on June 03, 2010, 03:20:59 pm
I'll try to test this out later. Glad to see you got some stuff working.
Title: Re: Calcalca
Post by: Deep Toaster on June 03, 2010, 06:10:25 pm
And here's another unoptimized update (with the promised eggs :)):

EDIT: Here (http://ourl.ca/5948/93600) is the fixed group, with more updates.
Title: Re: Calcalca
Post by: DJ Omnimaga on June 03, 2010, 06:24:07 pm
The group is corrupted :(

On the computer if I extract it I end up with another copy of the group file over and over and on the calc I get ERR:VERSION on Cosh-1( EQU
Title: Re: Calcalca
Post by: Deep Toaster on June 03, 2010, 07:54:19 pm
Again?

That's what happened to Cheater v3.0 when I first uploaded it to the computer, and when I got it on ticalc.org, people started complaining that a program with such a promising description didn't work. At least I got my first emails regarding my programs. :)

Unfortunately, I can't fix it until Monday, and maybe not even then....

EDIT: Oh, no, I just had a suspicion. There were a bunch of groups that didn't work when I tried them out on WabbitEmu. Maybe they have the same problem? I hope not. If so, half my entries on ticalc.org are corrupted.

EDIT2: NOOOOOO! IT'S TRUE! HALF MY PROJECTS HAVE COME TO NOTHING! :o EDIT5: Guess I did panic. There's hardly enough time to fix the problem for each project, though....

EDIT3: Maybe it's just me. Maybe I'm just panicking. Those of you out there who have the time, I'd REALLY appreciate it if you could test some of these out too. Please tell me they're not corrupted as well. :'(

EDIT4: Sorry if it seems like I'm just advertising my programs here, but I can't test them over any form of link until Monday, and I really need to know if they work. Once again, thank you so much to those of you willing to test it out.
Title: Re: Calcalca
Post by: DJ Omnimaga on June 03, 2010, 10:03:40 pm
That happeened to Illusiat 2004-R once (the english version of Illusiat 2004 that never got finished) x.x

Btw Absolute Insanity on ticalc works perfectly. However in the stuff you posted, the first four doesn't work :( (the Periodic one and Program1 ones works fine it seems)

I hope you got backups, though x.x
Title: Re: Calcalca
Post by: jsj795 on June 03, 2010, 11:22:44 pm
Are the groups on the calculator corrupted, or is it due to transfer?
Title: Re: Calcalca
Post by: DJ Omnimaga on June 03, 2010, 11:37:16 pm
It could be due to transfer. I am fairly certain it is. TI-Connect just sometimes accidentally your programs.
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 10:00:25 am
That happeened to Illusiat 2004-R once (the english version of Illusiat 2004 that never got finished) x.x

Oh, what happened in the end?

Btw Absolute Insanity on ticalc works perfectly. However in the stuff you posted, the first four doesn't work :( (the Periodic one and Program1 ones works fine it seems)

They don't work? They were my four newest programs.... :(

Thanks for telling me.

I think Abs Ins because I purposely avoided all external variables so I could export it as a single program. All of the single programs still work.

I hope you got backups, though x.x

No... :'(

It could be due to transfer. I am fairly certain it is. TI-Connect just sometimes accidentally your programs.

For some reason, it's only the groups that are like this (all the programs work fine on WabbitEmu). Does my changing the file extension make a difference? When I uploaded my groups to the computer via TI-Connect for Mac, it uploaded as a .8xo group. I always changed it to .8xg. It's worked before, so I don't know if that's the problem. ???
Title: Re: Calcalca
Post by: calcdude84se on June 04, 2010, 01:26:44 pm
Maybe it only worked for you... (and other mac users, with TI-Connect)
Gee, how much stuff did you lose (I'm not sure what those programs are)?
Title: Re: Calcalca
Post by: DJ Omnimaga on June 04, 2010, 05:09:43 pm
I think Mac TI-Connect isn't reliable for stuff like that. I recommend not sending your files as groups, personally, because the format is not the same between any software (except between TiLP and TI-Connect)

That said in Illusiat 2004-R case, I had a backup on my calc, fortunately, because on the computer, the programs were filled with garbage and were random sizes. The next time I sent them to my computer they were fine, but I never finished the project and I'm not even sure if I kept the backup x.x
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 06:27:48 pm
I think Mac TI-Connect isn't reliable for stuff like that. I recommend not sending your files as groups, personally, because the format is not the same between any software (except between TiLP and TI-Connect)

Didn't know that. >:(

Maybe it only worked for you... (and other mac users, with TI-Connect)
Gee, how much stuff did you lose (I'm not sure what those programs are)?

I don't know. I'll have to go back and individually check each of my released projects. Individual programs should work between different linking softwares, right?

Luckily, I found that I once transferred some of my programs onto a friend's TI-84+SE, so I could get them from him. :/

As for this program, I've included the files individually here:

EDIT: The newest update, now in a working group, is here (http://ourl.ca/5948/93600).
Title: Re: Calcalca
Post by: DJ Omnimaga on June 04, 2010, 07:12:54 pm
Do you have access to Windows computers, by the way?
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 07:15:36 pm
Do you have access to Windows computers, by the way?

Yeah, I'm using Vista right now. I use Macs only when I'm at school. I don't particularly like Windows because its file operations are so slow, and because the TI-Connect I use on Windows doesn't work half the time (see this post (http://ourl.ca/5948/92688)).
Title: Re: Calcalca
Post by: DJ Omnimaga on June 04, 2010, 07:17:55 pm
Yeah I also liked Mac user-friendliness more. I just wish there were more softwares for it, especially for calc stuff.

As for TI-Connect it's mostly TI fault, though. Even on compatible OSes, their software fails for many people and only works randomly.
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 07:30:09 pm
Yeah I also liked Mac user-friendliness more. I just wish there were more softwares for it, especially for calc stuff.

As for TI-Connect it's mostly TI fault, though. Even on compatible OSes, their software fails for many people and only works randomly.

Do you know if it's okay to change the .8xo to .8xg? I'm doing this because TI-Device Explorer uploads the groups as .8xo, but its own TI-Data Editor doesn't even support this file extension. :-\
Title: Re: Calcalca
Post by: DJ Omnimaga on June 04, 2010, 07:31:17 pm
I am not sure if they will work at all. Back in 2005, Speler had 8xo files and I tried renaming them to 8xg, and they failed. Can't you just send your files to the computer ungrouped (or ungroup them on the computer)?
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 07:32:08 pm
...don't know why I never thought of that...

...wow...

EDIT: Actually, I have tried ungrouping them. That doesn't even work. >:(

I've never tried sending the variables individually and grouping them on the computer, though...
Title: Re: Calcalca
Post by: DJ Omnimaga on June 04, 2010, 07:34:11 pm
Well, I asked since I was not sure if it was even possible at all on Mac. Back in the TI-Connect 1.2 days, you could only send your files as groups on the computer and on old versions of TiLP it automatically tried to group everything you tried to send.

I learned the hard way that group files are more problems than anything else in the community, because if you send any of my old calc RPG grouped to your calc using TI-Connect for windows, a lot will have the first program of each group be corrupted (ERR:UNDEFINED on launch). My inbox often got spammed in the past due to that in ROL3 RPG x.x
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 07:38:07 pm
Well, I asked since I was not sure if it was even possible at all on Mac. Back in the TI-Connect 1.2 days, you could only send your files as groups on the computer and on old versions of TiLP it automatically tried to group everything you tried to send.

TI-Connect for Mac, or at least the version our school is using, is a lot more advanced than the newest TI-Connect for Windows. I've created groups, lists, and even an entire program on it before.

[side note]Back then, I'd never heard of WabbitEmu. So when I wrote my first program completely coded on the computer, I had no way to test it, so I could only type code blindly. I finally got some time to try it out a few days ago, and to my utter surprise, it worked perfectly.[/side note]
Title: Re: Calcalca
Post by: DJ Omnimaga on June 04, 2010, 07:41:50 pm
Yeah that used to be available on TI-Connect Windows before. The group thing was called TI-Group Editor. Don't ask me why they got rid of them, though...
Title: Re: Calcalca
Post by: Deep Toaster on June 04, 2010, 07:43:22 pm
I learned the hard way that group files are more problems than anything else in the community, because if you send any of my old calc RPG grouped to your calc using TI-Connect for windows, a lot will have the first program of each group be corrupted (ERR:UNDEFINED on launch). My inbox often got spammed in the past due to that in ROL3 RPG x.x

That's exactly what happened when I tried OTBP Assembler. When it got to my calculator, program ASSEMBLE was only 13 bytes (which was definitely wrong), and the only way I found to fix it was to ungroup the group on SourceCoder (I was using a Windows computer) and send the files individually. And because I was using SourceCoder, I had to then go back through prgmASSEMBLE and change every r<sub size=6>1</sub> into an r6. >:(

[side note]At least the assembler itself worked pretty well. Can't wait for Mosaic to come out, though :)[/side note]

EDIT: Anyone have any opinions on the program (http://ourl.ca/5948/93195)? Still trying to figure out how to make it faster....
Title: Re: Calcalca
Post by: DJ Omnimaga on June 06, 2010, 12:52:10 pm
just tried it now, sadly I have absolutely no clue how to use the program :/
Title: Re: Calcalca
Post by: Deep Toaster on June 06, 2010, 01:12:41 pm
:-\

Anyway, TI-Connect at school works (I love Macs :D), so here's a version of my program. It comes as a group with two programs: CALCALCA (the main program) and LOW (an ASM subroutine to allow lowercase).

When you run prgmCALCALCA, nothing seems to happen, and the calculator still seems to be at the homescreen. It's actually already in the program; the blank screen is from the Input "",Str1. The program leaves most of the calculation intact, so if you type in a normal expression (such as 1+1), it'll just display the answer (with expr(Str1. The key is that the program checks for the string "_into_ or " INTO (notice the spaces), and if it's found within the input, it goes into evaluation mode.

Syntax for evaluation is [expression] into [unit] or [expression] INTO [unit] (again, notice the spaces). Other spaces are ignored by the evaluator, so you could type 5 N m into ft lb or 5Nm into ft*lb, and it would display the same answer. This is so that input is more natural and easier to read. However, the program is actually looping through each character in the string input, so the shorter the input, the faster the program can evaluate it.

If the units are mismatched on the two sides of the input, the programs throws an ERR:MISMATCH, but I have yet to add the other error messages (e.g., for unrecognized units).

I haven't compiled a list of supported units left, but in case you're wondering, they're all in Str1 (after you run the program at least once). Just look for the alpha characters. By the way, the program is case sensitive, so mPa is millipascals, while MPa is megapascals. Do not put an extra s at the end of a unit, even for a unit such as lb.

All SI prefixes from yocto to Yotta are supported, except for milli- and Tera- on three-character base units (such as cal, acr, and are), as well as millitonnes (who would ever use that?). All units must be abbreviated. Thus, 5 amperes2*6 ohms INTO milliwatts will not work, while 5 A2*6 ohm INTO mW will.

Addition, subtraction, and functions are not supported, and probably never will be, but since they are simply skipped over by the evaluator, 8 J into ft-lb will be read as "8 (J)" into "(ft)(lb)". Unlimited numbers of parentheses, division, exponentiation (including 2, 3, and -1), and multiplication (duh) are supported.

I know, the program still runs pretty slowly. I'll still have to optimize some things. Until then, everyone is allowed (and encouraged) to look into the code, and suggestions are (very) welcome.

Heh, I might just use that for the documentation. Might not be detailed enough for that purpose, though...

Anyway, just type [blah] into [blah]. It's supposed to be as close to Google Calculator (http://www.google.com/help/calculator.html) as possible, with the exception that the conversion keyword is into or INTO , not in (for fear of confusing it with in for inches).
Title: Re: Calcalca
Post by: DJ Omnimaga on June 06, 2010, 03:52:38 pm
yeah I've read that and couldn't understand. I even tried. I typed 10CM INTO INCH, for example, and it gave 0.
Title: Re: Calcalca
Post by: calcdude84se on June 06, 2010, 04:16:37 pm
Should there be a space after 10? I haven't tried it myself, so I'm just throwing out suggestions. Also, maybe it should be IN, rather than INCH? (Maybe case matters too)
Title: Re: Calcalca
Post by: Builderboy on June 06, 2010, 04:21:29 pm
I tried '7IN INTO CM' and it gave a syntax error :( i also tried '7 IN INTO CM' and '7 In Into Cm' and '7In Into Cm' and they all gave syntax errors :( and when i press goto it just goes to the program
Title: Re: Calcalca
Post by: Deep Toaster on June 06, 2010, 06:26:33 pm
Should there be a space after 10? I haven't tried it myself, so I'm just throwing out suggestions. Also, maybe it should be IN, rather than INCH? (Maybe case matters too)

Yeah, sorry I wasn't clear on this. Units must be abbreviated (this will probably never change, as adding the full names of units will cause a huge increase in filesize). Syntax is file sensitive, so that the calculator can differentiate between, say, Pa (pascals) and PA (petaamperes). About the space after the 10, spaces are ignored for a loose evaluation. Thus, ftlb, ft-lb, and ft lb are all read as "foot pounds".


I tried '7IN INTO CM' and it gave a syntax error :( i also tried '7 IN INTO CM' and '7 In Into Cm' and '7In Into Cm' and they all gave syntax errors :( and when i press goto it just goes to the program

Debugging…
Please hold…


EDIT: What I have found thus far: syntax error that redirects to the program name would probably an error in evaluating the expr( of a string somewhere buried in the program.

Still debugging…
Please hold…


EDIT2: Forget about what I said in the previous edit. The only problem here is that the input is, once again, case sensitive. Asm(prgmLOW is included as the first command in the main program so that lowercase letters are enabled no matter what.

AutoDebug
            Done


EDIT3: About grouping and ungrouping files on the computer: Has anyone used the Group File Manager (http://www.ticalc.org/archives/files/fileinfo/427/42791.html)? Will it create groups recognized by all the platforms of TI-Connect?

EDIT4: So is Builderboy's situation, if you type 7 in into cm, 7in into cm, or 7*in into cm, it should work. The only thing in the input that is not (entirely) case sensitive is the word INTO, and even then, it can only accept into or INTO, not something like iNtO (though I can't think of any reason why anyone would take the time to do this).
Title: Re: Calcalca
Post by: meishe91 on June 06, 2010, 09:27:18 pm
Ok, so I just tried this on WabbitEmu. I tried converting 180 pounds into kilograms and got a ERROR:MISMATCH. I tried "180lb into kg" and "180lbs into kg" (in case you differentiated between the two for some reason) and it didn't work.

Edit: Side note: If it would be possible you should maybe change when you press the Θ button it outputs a Ω instead for ohms because it is odd saying "kohm" for kilo-ohms. Just my opinion anyways, its not a big deal though.
Title: Re: Calcalca
Post by: Deep Toaster on June 06, 2010, 09:32:38 pm
Ok, so I just tried this on WabbitEmu. I tried converting 180 pounds into kilograms and got a ERROR:MISMATCH. I tried "180lb into kg" and "180lbs into kg" (in case you differentiated between the two for some reason) and it didn't work.

You just happened to choose the one unit I still have to develop. :)

Strictly scientifically speaking, the pound is a unit of force, not mass. So if you tried 180 lb into N, it would work.

Sorry about the mix-up. I'm too much of a nerd to purposely disappoint the scientists out there.
Okay, scratch all that. :)

EDIT: And that reminds me: I'm still trying to figure out how to let lb double as a measure of force and a measure of mass, since all the non-scientists in the world would mistakenly convert lb as a unit of mass (assuming that many people actually use my program ;D). So far, the only solution I've found is to specifically search for the substring "lb" and label it as both a unit of mass and a unit of weight, but you can imagine how much slower the program would run, and the Calcalca is already too slow for my own personal preferences.
Title: Re: Calcalca
Post by: meishe91 on June 06, 2010, 09:47:02 pm
Actually technically a pound (http://en.wikipedia.org/wiki/Pound_(mass)) is a measure of mass and a pound-force (http://en.wikipedia.org/wiki/Pound-force) is the measurement of force. Both are just abbreviated lb (or can be; mass is technically lb, lbm, lbm and force is lb, lbf, or lbf).

To convert from lbm to kg all you do is multiply by 0.45359237 kg. Then to turn lbf into N you just multiply by both 0.45359237 kg and 9.80665 m/s2. So one lbf equals about 4.44822 N.

Edit: What you could do is differentiate between the two by making the user type in either lbm or lbf and then have the two separate conversions.
Title: Re: Calcalca
Post by: Quigibo on June 06, 2010, 09:55:15 pm
Why don't you just simply NOT make a distinction between mass and weight.  Just make all conversions that do happen to go between a mass and a weight use earth gravity 9.81 m/s^2 for the acceleration automatically implied in the conversion.
Title: Re: Calcalca
Post by: Deep Toaster on June 06, 2010, 09:57:10 pm
Actually technically a pound (http://en.wikipedia.org/wiki/Pound_(mass)) is a measure of mass and a pound-force (http://en.wikipedia.org/wiki/Pound-force) is the measurement of force. Both are just abbreviated lb (or can be; mass is technically lb, lbm, lbm and force is lb, lbf, or lbf).

What?! That makes my job even harder. :(
Didn't know that. Thanks for telling me.

To convert from lbm to kg all you do is multiply by 0.45359237 kg. Then to turn lbf into N you just multiply by both 0.45359237 kg and 9.80665 m/s2. So one lbf equals about 4.44822 N.

Whoops, I mixed the two. More changes now needed. :(
EVERYONE: UNTIL FURTHER NOTICE, DO NOT TEST OUT CONVERSIONS DEALING WITH POUNDS OF ANY SORT.

Edit: What you could do is differentiate between the two by making the user type in either lbm or lbf and then have the two separate conversions.

Don't want to put the extra work on the user, though. I want to keep this as easy to use as possible, and most people probably wouldn't use lbm for pounds mass. At the same time, I want compatibility with pounds force being lb, as in "ft-lb".
Title: Re: Calcalca
Post by: meishe91 on June 06, 2010, 09:59:02 pm
@Quigibo
Because they technically aren't the same thing. Force already has gravity in it while mass doesn't. Unless you are talking about like when it displays you have the mass displayed and then it also shows the acceleration of gravity? I'm not entirely sure what you are asking but ya...I don't know :P
Title: Re: Calcalca
Post by: Deep Toaster on June 06, 2010, 09:59:57 pm
Why don't you just simply NOT make a distinction between mass and weight.  Just make all conversions that do happen to go between a mass and a weight use earth gravity 9.81 m/s^2 for the acceleration automatically implied in the conversion.

Hmm, that's a good idea. At the end, when Calcalca tests whether or not the units on either side are identical, I could make it detect whether the difference is m*s-2, and add a 9.81 as a conversion factor...
Thanks!

EDIT: What if it's not on Earth, though? :)

Seriously, though, I might actually add that.

Because they technically aren't the same thing. Force already has gravity in it while mass doesn't. Unless you are talking about like when it displays you have the mass displayed and then it also shows the acceleration of gravity? I'm not entirely sure what you are asking but ya...I don't know :P

I think this is what Quigibo means.
Title: Re: Calcalca
Post by: meishe91 on June 06, 2010, 10:09:38 pm
Well another thing you could do is when it comes to pounds (force or mass) you can test what the output is being put into (either N or kg or whatever) and have it calculate accordingly. I don't know how practical that is though.

Side Question: Does this support slugs? Not that slugs are used much anymore but ya.
Title: Re: Calcalca
Post by: Deep Toaster on June 06, 2010, 10:12:50 pm
Well another thing you could do is when it comes to pounds (force or mass) you can test what the output is being put into (either N or kg or whatever) and have it calculate accordingly. I don't know how practical that is though.

I like Quigibo's idea better because it's simpler and tests only if there's a difference between the sides, meaning that most conversions wouldn't be affected by the extra evaluation time.

EDIT: Except where the unit of mass/weight is raised to some power other than one. But who would use lb2 anyway?

EDIT2: Found a good way to check for discrepancies regarding lb. Adding comparison now. Hopefully I'll finish before finals week. :P

EDIT3: Yeah, I was thinking of adding slugs, but I need a 3-letter abbreviation for it. Would slg work?

EDIT4: Fixed lb problem! Here it is:

EDIT5: Another record (for me). 5 edits in a single post.

Anyway, I've also gotten it to work as a group. Thanks for the tip, and here it is (again):
Title: Re: Calcalca
Post by: DJ Omnimaga on June 08, 2010, 02:15:02 am
cool I just sent the new group on my calc and it works. Glad you could get 8xg files to work.
Title: Re: Calcalca
Post by: meishe91 on June 08, 2010, 02:21:59 am
Well I don't think there is a real abbreviation for slugs but ya I'm sure "slg" would work. Glad to hear you got the pound issue fixed. What did you end up doing?
Title: Re: Calcalca
Post by: Deep Toaster on June 08, 2010, 09:47:50 am
Well I don't think there is a real abbreviation for slugs but ya I'm sure "slg" would work. Glad to hear you got the pound issue fixed. What did you end up doing?

Basically, I compared the base unit lists for either side of the expression. If there is no difference in mass or amperage, and if the difference in time is the opposite of twice the difference in distance, the program assumes that it should now add in the 9.81 m/s2, raised to the power of the difference in distance, to account, so lb should now work no matter what power it is raised to (sorry if this explanation is confusing). The only problem is that if you entered, say, 8 kg into N, it would also change kg into a unit of force, since the program doesn't actually detect the specific unit lb.

Okay, now I really need to optimize it. The program is slow. :(
Title: Re: Calcalca
Post by: squidgetx on June 08, 2010, 05:05:48 pm
looks nice
you're right, though, the speed is painful
also, i would suggest not clearing the homescreen after a unit conversion, and not having parentheses for prefixes (though i don't know how possible that is)
I like how you also included Google's little "answer to life/universe/everything) ;)

edit: do you think you need parentheses at all? i can't really see why they need to be there for clarity ( i mean, (7 (in))=17.78((c)m))) is kind of silly
and i can't think of why they'd be needed for coding purposes...although i may be wrong about that

edit2 didnt read your whole first post. so, parentheses ARE needed...damn

edit3 lol i'm a little "submit button" happy today...what if you ran another routine that's kind of like a "find and delete" to kill parentheses? although it might make the program even slower...and also tightening the user's syntax to allow for spaces to be cushions over parentheses might be viable...

Also, it's a pain that variables can't be stored in-program... although the only way for that to be allowed would be with ASM..sigh..guess you can't have everything
Title: Re: Calcalca
Post by: Deep Toaster on June 08, 2010, 07:01:29 pm
looks nice
you're right, though, the speed is painful
also, i would suggest not clearing the homescreen after a unit conversion, and not having parentheses for prefixes (though i don't know how possible that is)

I have to clear the homescreen because I use Output( to display the answer, and there's no way to tell what line I'm on except with *sigh* ASM.

Guess I could use Disp, but then textwrapping would be a nightmare. :(

I like how you also included Google's little "answer to life/universe/everything) ;)

Had to add that. I found that answer, anyway. ;)

edit: do you think you need parentheses at all? i can't really see why they need to be there for clarity ( i mean, (7 (in))=17.78((c)m))) is kind of silly
and i can't think of why they'd be needed for coding purposes...although i may be wrong about that

edit2 didnt read your whole first post. so, parentheses ARE needed...damn

Parentheses actually makes life easier for the program. It's kind of hard to explain now, but basically, if there were no parentheses, I would have to add a lot more duplicate coding, making the size approximately double. Though it would make the program a little faster, I guess...

edit3 lol i'm a little "submit button" happy today...

I do that all the time. :D

what if you ran another routine that's kind of like a "find and delete" to kill parentheses? although it might make the program even slower...and also tightening the user's syntax to allow for spaces to be cushions over parentheses might be viable...

What do you mean by "cushions"?

The way spaces are implemented now, they're pretty much ignored. I'm actually taking advantage of the fact that the program adds so many unnecessary parentheses here; because of this, the user can add as many spaces as he wants and they would all be counted as implicit multiplication.

Also, it's a pain that variables can't be stored in-program... although the only way for that to be allowed would be with ASM..sigh..guess you can't have everything

Yeah...but what kind of "variables" would you want to store? If you think it's a good idea to store the answer or the original expression, it'd be pretty easy to add that in at the end.

EDIT: Whoa... I just realized I had a habit of making REALLY LONG POSTS.
Title: Re: Calcalca
Post by: jsj795 on June 09, 2010, 12:08:20 am
I was looking through the program, and I thought, hmm... wouldn't it be easier if you knew all the variables calculator can accept? Like, you can implement scrollable menu that shows what unit you want to put in, and what output unit you want, something like itouch menu.
I think that will lessen the user making syntax error that the calculator doesn't recognize and lessen the frustration, them going like, 15 In into m instead of 15 in into m.
Title: Re: Calcalca
Post by: meishe91 on June 09, 2010, 05:44:53 am
looks nice
you're right, though, the speed is painful
also, i would suggest not clearing the homescreen after a unit conversion, and not having parentheses for prefixes (though i don't know how possible that is)

I have to clear the homescreen because I use Output( to display the answer, and there's no way to tell what line I'm on except with *sigh* ASM.

Guess I could use Disp, but then textwrapping would be a nightmare. :(

I like how you also included Google's little "answer to life/universe/everything) ;)

Had to add that. I found that answer, anyway. ;)

edit: do you think you need parentheses at all? i can't really see why they need to be there for clarity ( i mean, (7 (in))=17.78((c)m))) is kind of silly
and i can't think of why they'd be needed for coding purposes...although i may be wrong about that

edit2 didnt read your whole first post. so, parentheses ARE needed...damn

Parentheses actually makes life easier for the program. It's kind of hard to explain now, but basically, if there were no parentheses, I would have to add a lot more duplicate coding, making the size approximately double. Though it would make the program a little faster, I guess...

edit3 lol i'm a little "submit button" happy today...

I do that all the time. :D

what if you ran another routine that's kind of like a "find and delete" to kill parentheses? although it might make the program even slower...and also tightening the user's syntax to allow for spaces to be cushions over parentheses might be viable...

What do you mean by "cushions"?

The way spaces are implemented now, they're pretty much ignored. I'm actually taking advantage of the fact that the program adds so many unnecessary parentheses here; because of this, the user can add as many spaces as he wants and they would all be counted as implicit multiplication.

Also, it's a pain that variables can't be stored in-program... although the only way for that to be allowed would be with ASM..sigh..guess you can't have everything

Yeah...but what kind of "variables" would you want to store? If you think it's a good idea to store the answer or the original expression, it'd be pretty easy to add that in at the end.

EDIT: Whoa... I just realized I had a habit of making REALLY LONG POSTS.

If you did do something that would make it faster but you'd have repeditive code you could always make either a sub-program that is recalled or put a Lbl at the top of the program with the code.

I was looking through the program, and I thought, hmm... wouldn't it be easier if you knew all the variables calculator can accept? Like, you can implement scrollable menu that shows what unit you want to put in, and what output unit you want, something like itouch menu.
I think that will lessen the user making syntax error that the calculator doesn't recognize and lessen the frustration, them going like, 15 In into m instead of 15 in into m.

His whole goal is to try to make it like the Google thing, I believe. Which has you type everything in.
Title: Re: Calcalca
Post by: Deep Toaster on June 09, 2010, 10:12:01 am
If you did do something that would make it faster but you'd have repeditive code you could always make either a sub-program that is recalled or put a Lbl at the top of the program with the code.

Oh, yeah, I heard about that trick with the For( loop and the end inside the label. Does it only work with For( loops, not While or Repeat ?
Title: Re: Calcalca
Post by: SirCmpwn on June 09, 2010, 10:48:46 am
I'm not entirely sure about how you are saying this, but if you want to Goto from a While, For(, Repeat, or If statement, you can have that many End statements on the end of it.  For example:
Code: [Select]
If 1
Then
If 1
Then
While 1
If getKey=105
Goto A
If getKey=21
Goto B
End
End
End
Lbl A
End
End
End
Disp "No memory leak!
Return
Lbl B
Disp "Memory leak!
Title: Re: Calcalca
Post by: Deep Toaster on June 09, 2010, 07:50:17 pm
Oh, it works for all the loops...

That'll be helpful. Thanks.
Title: Re: Calcalca
Post by: SirCmpwn on June 09, 2010, 07:51:34 pm
Sure thing.
Title: Re: Calcalca
Post by: meishe91 on June 09, 2010, 10:55:37 pm
If you did do something that would make it faster but you'd have repeditive code you could always make either a sub-program that is recalled or put a Lbl at the top of the program with the code.

Oh, yeah, I heard about that trick with the For( loop and the end inside the label. Does it only work with For( loops, not While or Repeat ?

What trick are you talking about? I just meant if you have repetitive code put it at the top of the program in a Lbl since TI-BASIC scans from top to bottom when searching for Lbls.
Title: Re: Calcalca
Post by: ztrumpet on June 09, 2010, 11:00:10 pm
Like this:

:Goto 1
:Lbl 2
:<subroutine here>
:End
:Lbl 1
:<code here>
:If <want to run subroutine>
:Then
:For(A,-1,0)  //CLOSE THIS!
:If A
:Goto 2
:End
:End
:<code here>
Title: Re: Calcalca
Post by: Deep Toaster on June 10, 2010, 09:54:00 am
If you did do something that would make it faster but you'd have repeditive code you could always make either a sub-program that is recalled or put a Lbl at the top of the program with the code.

Oh, yeah, I heard about that trick with the For( loop and the end inside the label. Does it only work with For( loops, not While or Repeat ?

What trick are you talking about? I just meant if you have repetitive code put it at the top of the program in a Lbl since TI-BASIC scans from top to bottom when searching for Lbls.

That trick where, if a loop Gotos out to some Lbl, you can put the End in that label, even if it's before the loop that required it, and the loop won't cause any memory leaks.
Title: Re: Calcalca
Post by: Builderboy on June 10, 2010, 11:43:23 am
Hey i made my own version of Calcalc, do you mind if i post it?
Title: Re: Calcalca
Post by: Deep Toaster on June 10, 2010, 06:07:46 pm
Hey i made my own version of Calcalc, do you mind if i post it?

Sure. Do you mind if I look through the coding?

EDIT: Wait, what language is it? BASIC, right?
Title: Re: Calcalca
Post by: Builderboy on June 10, 2010, 06:33:51 pm
Yeah its Basic, and pretty fast if i do say so myself.  Here are the programs, run Calc to run the program.  Syntax is very loose, but there are no lowercase, since i thought that it would be more hassle than its worth to type them in, plus when the program is compiled into a single program, it means that there will be only a single program (about 1000 bytes).  These next aexpressions are all legal:

5M TO CM
5M TO CM
5 M TO CM
5(M) TO CM

It currently supports these units, although adding more is trivial:
Code: [Select]
Meters  (m)
Centimeters (cm)
Milimeters (mm)
Kilometers (km)
Inches (in)
Feet (ft)
Yards (yd)
Miles (Ml)
Kilograms (KG)
Grams (G)
Pound mass (lbm)
Ounce (oz)
Newton (n)
Pascal (pa)
PSI (psi)
Joules (j)
Electron Volts (ev)
Seconds (s)
Minutes (min)
Hours (h)
Pound Force (lbf)
Watts (w)
KiloWatts (kw)
Volts (v)
KiloVolts (kv)
Ohms (ohm)
Amps (a)

The program is also written so that adding extra units does not impact speed very much at all.  It does have some load time at startup though.  I wanted to keep size at a minimum so it precalculates a lot of data.

EDIT: Also note that i dont do any unit checking so it lets you do silly things like convert feet to seconds :P
Title: Re: Calcalca
Post by: Deep Toaster on June 10, 2010, 06:46:26 pm
Wow, that is fast. And small.
Title: Re: Calcalca
Post by: DJ Omnimaga on June 10, 2010, 07:42:55 pm
wow nice Builderboy!
Title: Re: Calcalca
Post by: Builderboy on June 23, 2010, 02:46:48 am
I hope i didnt kill this project D: Has there been any progress?
Title: Re: Calcalca
Post by: Deep Toaster on June 25, 2010, 10:55:24 pm
Don't worry, I'm never gonna give this up :) Calcalca is still on my calculator (in the form of a group), but I'm not going to be working on it for a while (I've put it in "indefinite hold" mode).

The biggest problem right now is the speed, as everyone will probably notice. I like the way your program converts the data to a list at startup, but for me to do that, I'd have to use at least five lists and two matrices, which would be both slow to initialize and hard to keep track of.

I probably won't be able to work more on Calcalca until September, since I'm in China right now (away from my calculator for a month and a half -- it's been absolutely horrible), and when I get back in mid-August, there's still a lot to do in terms of my Axe contest entry and a stupid AP Lang summer project.

EDIT: On second thought, I just came up with an idea that would let me start it up faster with only two lists. I'm still probably not going to be working on this for a bit, though.
Title: Re: Calcalca
Post by: DJ Omnimaga on June 25, 2010, 11:12:24 pm
Ouch sorry to hear you cannot work on it anymore x.x

I'm glad it is not dead, though. I can't wait for your return. Are you still gonna be able to visit, btw? (well... through whatever mean you can use to bypass the "Great Firewall Of China")
Title: Re: Calcalca
Post by: Deep Toaster on June 25, 2010, 11:28:50 pm
Yes, they haven't blocked Omnimaga, thankfully, and I don't see any reason for them to. It's not like calculator programming threatens Communist totalitarianism :D

On the other hand, there's no doubt the Great Firewall exists. I can't access Google Images from any domain, and whenever I try to access a politically opinioned website, even if it's from a link on Google, the page magically doesn't exist.

Earlier in the Firewall's history, the Chinese Internet police actually displayed on some open websites a cute little cartoon mascot of two police officers with the "cute" slogan "Watching you, watching me." I'd give you a link now, but it's blocked too :)

EDIT: Probably shouldn't even post that. I wouldn't want to get Omni blocked here :P
Title: Re: Calcalca
Post by: DJ Omnimaga on June 25, 2010, 11:31:28 pm
Oh ok because Nitacku was in china recently (I forgot where... just search for Nitacku in recent #omnimaga/OmnomIRC logs and you might find it) and he had to proxy his way through IRC and Omnimaga to access them.
Title: Re: Calcalca
Post by: Deep Toaster on June 25, 2010, 11:37:59 pm
And speaking of the Great Firewall, can you still see the userbars below? They display as
x
's to me, and I can't figure out if it's because ImageShack deleted the files or because they're blocked by the Wall.
Title: Re: Calcalca
Post by: DJ Omnimaga on June 25, 2010, 11:52:22 pm
They're still here. Imageshack is probably blocked

I do not see the United-TI one, though (unless you removed it?)
Title: Re: Calcalca
Post by: Deep Toaster on June 26, 2010, 01:14:46 am
Yeah, I did. I don't want to cram up topics with my signature :)
Title: Re: Calcalca
Post by: DJ Omnimaga on June 26, 2010, 01:22:04 am
That said, if you want it back, I think there was a better UTI userbar somewhere. (the one you used was nice but it seemed like it was for Invision Power company site, the company that made the forum software UTI uses). I think KermMartian made them. You would need to ask him on Cemetech forums (or search for them there). He even had some for Omnimaga, but they no longer match the site theme.
Title: Re: Calcalca
Post by: Builderboy on June 26, 2010, 02:44:39 pm
Glad you are not killing this :) I was hoping my release hadn't made you lose hope D: but im glad it didnt ^^
Title: Re: Calcalca
Post by: Deep Toaster on June 26, 2010, 08:01:23 pm
By the way, what does your signature say?
Title: Re: Calcalca
Post by: Builderboy on June 26, 2010, 08:06:04 pm
It says 'can you read this' in an alternate language ^-^
Title: Re: Calcalca
Post by: Deep Toaster on June 26, 2010, 11:22:17 pm
Tried to figure out what language it is, but Google Translate doesn't even recognize the characters.

EDIT: I really wish I could remote server my calc. We're over 1470 miles apart :(

EDIT2: And that's in hex :'(
Title: Re: Calcalca
Post by: DJ Omnimaga on June 27, 2010, 12:46:01 am
I don't remember what it was, but was it the language in Avatar movie?

Also I still remember on APril 1st when you wrote all your posts with inverted letters x.x

Title: Re: Calcalca
Post by: ztrumpet on July 01, 2010, 09:14:55 am
Also I still remember on APril 1st when you wrote all your posts with inverted letters x.x
Same here. :P

I'm glad this isn't dead as well. :)

I'm pretty sure Kerm made the UTI userbar that I use. :)
Title: Re: Calcalca
Post by: DJ Omnimaga on July 01, 2010, 06:49:17 pm
Yeah he did. He made some for UTI, Cemetech, Ticalc.org, Omni and I believe a few other sites as well.
Title: Re: Calcalca
Post by: Deep Toaster on July 02, 2010, 12:11:12 am
I'm glad this isn't dead as well. :)

Thanks!

By the way, where do you store your userbars? I store them at ImageShack (http://www.imageshack.us/), which is apparently blocked here.

EDIT: Aug, I really wish I'd at least brought my thumb drive along. I have WabbitEmu installed on it, as well as my ROM image and all my programs. In other words, I would be able to work on it right now :P
Title: Re: Calcalca
Post by: DJ Omnimaga on July 02, 2010, 02:40:46 am
What about Photobucket and tinypic?

You can upload them in a post on Omni, though, then link to the URL in an img tag.
Title: Re: Calcalca
Post by: Deep Toaster on July 02, 2010, 03:10:02 am
You can upload them in a post on Omni, though, then link to the URL in an img tag.

Heh, that's a good idea. I'll do that when I get back.

Also I still remember on APril 1st when you wrote all your posts with inverted letters x.x

I ... don't remember that. April of this year?
Title: Re: Calcalca
Post by: Builderboy on July 02, 2010, 03:13:42 am
Haha yep, all of my posts were upside down.  Including all my info, location ect...  If it was possible i would have even changed my name :P


Hmmm i wonder if the anti-profanity filter would be abused to invert the entire site? ^-^
Title: Re: Calcalca
Post by: DJ Omnimaga on July 02, 2010, 03:17:43 am
Lol that could be done. I did it with all caps once to test. Cooliojazz noticed it for the 3 seconds it lasted and freaked out XD. It was a while ago. However, editing a post would make its changes permanent. Once I would remove the filter, everything except that post would go back to normal
Title: Re: Calcalca
Post by: Builderboy on July 02, 2010, 03:24:01 am
Haha ill keep that in mind for next April ^-^
Title: Re: Calcalca
Post by: Deep Toaster on September 01, 2010, 02:03:54 pm
Sooo, now that my contest entry's "safely" in a group ;), I can finally get back to this, but after a coupla months of playing with Axe, I'm amazed by how slow TI-BASIC really is ... shows how much Axe changed my perception...
Title: Re: Calcalca
Post by: DJ Omnimaga on September 01, 2010, 02:26:43 pm
Yeah when I started Axe it was hard to get back to BASIC afterward. Same happens with ASM, apparently. I hope you be careful though with groups. We never know what can happen to them :/
Title: Re: Calcalca
Post by: Builderboy on September 01, 2010, 02:31:27 pm
When you say in Group, do you mean backed up in a group folder?  Because if thats too, bear in mind Group files are not 100% safe O.O Much better to back up on the computer or in a 2nd method on calc.

As for calcalc, thats what i like about TiBasic :) It has such a slow language that it forces you to become a very efficient coder in order to get good programs.  Whereas with languages like Axe and C and Java and the like, making horrible inefficient mistakes, you can still have fast programs, but it might kill you later on once you've developed bad habits.

Anyways, glad to see you resuming work on this :)
Title: Re: Calcalca
Post by: Deep Toaster on September 01, 2010, 02:37:04 pm
Unfortunately, groups are the most secure way of backing stuff up that I know of on-calc x.x

As for calcalc, thats what i like about TiBasic :) It has such a slow language that it forces you to become a very efficient coder in order to get good programs. Whereas with languages like Axe and C and Java and the like, making horrible inefficient mistakes, you can still have fast programs, but it might kill you later on once you've developed bad habits.

Yeah, that's why I didn't see anything wrong with using sum(mid(list),5,1) instead of list[5] on the Nspire. It's just too fast for it to matter.

Anyways, glad to see you resuming work on this :)

Thanks.

EDIT: 400 Bad Request
Title: Re: Calcalca
Post by: Builderboy on September 01, 2010, 02:38:10 pm
Axe has a backup feature, it copies programs into Apvars and you can restore them later :)
Title: Re: Calcalca
Post by: Deep Toaster on September 01, 2010, 02:39:44 pm
Axe has a backup feature, it copies programs into Apvars and you can restore them later :)

Yeah, but I don't have the latest Axe yet...

You know what would be awesome? An Axe decompiler. That way, if someone lost the source but somehow still has a copy of the exec (for example, if they were in separate groups), he could still keep working. It'd be pretty hard to make one, though...
Title: Re: Calcalca
Post by: Builderboy on September 01, 2010, 02:42:06 pm
Ah, well then you can just do two or more separate groups if you're really worried.  The probability of 2 groups failing is much less.  As for a decompiler, you would have to ask Quigibo how possible that is, im worried that it may, in fact, be *impossible* D:
Title: Re: Calcalca
Post by: DJ Omnimaga on September 01, 2010, 04:26:54 pm
it would sure be hard to interpret z80 ASM to translate it to Axe source x.x, plus I bet you would lose pointer names and the like
Title: Re: Calcalca
Post by: meishe91 on September 01, 2010, 05:34:03 pm
Glad to see this being continued to have work done on it now :)

As for the decompiler I agree. I don't think it's impossible but I think it would be incredibly hard and take a long time.
Title: Re: Calcalca
Post by: Deep Toaster on September 01, 2010, 06:26:49 pm
As for the decompiler I agree. I don't think it's impossible but I think it would be incredibly hard and take a long time.

What about on the computer, though?
Title: Re: Calcalca
Post by: meishe91 on September 01, 2010, 06:31:51 pm
It'd still be hard. I mean it's kinda like making a TI-BASIC to assembly converter. This would be a little easier since Quigibo, I think, knows how everything parses and into what but it'd still be hard. I didn't mean it would take a long time to parse, just to create it.
Title: Re: Calcalca
Post by: Builderboy on September 01, 2010, 06:45:18 pm
Hmmm some of it might be easy, since so much is put into subroutines, calls to those could be directly decompiled.  But yeah, if someone were to write this, it would either have to be Quigibo or someone with access to Axe parser source.