Author Topic: Calcalca  (Read 27435 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #45 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)?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #46 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...
« Last Edit: June 04, 2010, 07:33:28 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #47 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
« Last Edit: June 04, 2010, 07:35:46 pm by DJ Omnimaga »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #48 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]
« Last Edit: June 04, 2010, 07:43:13 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #49 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...

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #50 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? Still trying to figure out how to make it faster....
« Last Edit: June 05, 2010, 08:41:16 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #51 on: June 06, 2010, 12:52:10 pm »
just tried it now, sadly I have absolutely no clue how to use the program :/

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #52 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 as possible, with the exception that the conversion keyword is into or INTO , not in (for fear of confusing it with in for inches).
« Last Edit: June 06, 2010, 01:15:06 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Calcalca
« Reply #53 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.
« Last Edit: June 06, 2010, 03:52:52 pm by DJ Omnimaga »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Calcalca
« Reply #54 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)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Calcalca
« Reply #55 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

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #56 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? 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).
« Last Edit: June 06, 2010, 09:08:53 pm by Deep Thought »




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Calcalca
« Reply #57 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.
« Last Edit: June 06, 2010, 09:32:51 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Calcalca
« Reply #58 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.
« Last Edit: June 06, 2010, 09:50:10 pm by Deep Thought »




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Calcalca
« Reply #59 on: June 06, 2010, 09:47:02 pm »
Actually technically a pound is a measure of mass and a 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.
« Last Edit: June 06, 2010, 09:49:07 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)