Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - sammyMaX

Pages: [1] 2
1
TI-Nspire / TI-Planet Contest: The Treasure of Knossos
« on: June 25, 2013, 09:29:31 pm »
(This should probably be in news)
TI-Planet is having a big programming contest, and this time it's to make an AI for the game Wumpus. The full description is http://tiplanet.org/forum/viewtopic.php?p=144685#p144685 but basically, you have to kill the monster with your arrow and get the treasure and then leave. The Lua script will only tell you information about your immediate surroundings though, so it's tricky  :P

I got that from Google Translate/English part of post, so could someone explain these things to me:
1. Is there a limit to n (number of rooms)? Because the window just looks ridiculous once n>16 or so.
2. Could someone please translate these two lines? They didn't do well with Google Translate:
"La seule chose interdite sous peine de disqualification est d'utiliser/modifier les autres fonctions ou variables préfournies par le script."
"soit l'opposé du numéro d'une salle voisine dans laquelle tirer une flèche pour y tuer le Wumpus"
3. What type of calculator will this be run on? Can I assume that it has Ndless r825 and that it's an Nspire CX or Nspire CX CAS (NOT a black/white calc)?

2
TI-BASIC / sammyMaX's Nspire PalPrime
« on: May 14, 2013, 05:59:36 pm »
darn my code is waayyy longer than Jim Bauwens's and Xeda's...

My submission was in Nspire basic, and it had two helper functions along with the main palprime function. The main function generates palindromes and gives them to the prime tester. The prime tester uses the Miller-Rabin algorithm, which requires modular exponentiation, so there is also a modular exponentiation function. My code for each:
exprem (Modular Exponentiation)
primetest (Miller-Rabin Test)
palprime (Palindrome Generator and Main Function)
It takes around 2 seconds to calculate the 100th palprime, 6 seconds for the 250th palprime, 16 seconds for the 500th palprime, and 39 seconds for the 1000th palprime. The times were taken from an emulated Nspire CX running OS 3.1.0, at 100% emulation (normal speed).

3
Calculator C / How to Remove Newlib Syscalls?
« on: November 21, 2012, 06:42:28 pm »
After ~half a year, I'm back :)

I'm trying to port GMP to the Nspire again. I think the library will work fine, but I'm having some problems with newlib, which is supplying its own syscalls that interfere with the ones included with Ndless. Here are the compiler errors:
Code: [Select]
nspire-ld hello.o -o helloworld.elf -L /home/philip/gmp/prefix/lib -lgmp
/home/philip/toolchain/lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/libc.a(lib_a-syscalls.o): In function `_exit':
/home/philip/toolchain/build/arm-none-eabi/newlib/libc/sys/arm/../../../../../../newlib-1.20.0/newlib/libc/sys/arm/syscalls.c:459: multiple definition of `_exit'
/home/philip/NdlessSDK/ndless/bin/../system/osstub.o:osstub.c:(.text+0x88): first defined here
/home/philip/toolchain/lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/libc.a(lib_a-syscalls.o): In function `_sbrk':
syscalls.c:(.text+0x6a8): undefined reference to `end'
collect2: error: ld returned 1 exit status
make: *** [helloworld.tns] Error 1

Are there any compiler flags to disable the newlib syscalls? And what is the cause of the second error?
And by the way, I never knew the toolchain was so big!! 1.3 GB?

4
General Calculator Help / Help with DummyOS and OSLauncher
« on: May 02, 2012, 05:39:56 pm »
I tried running DummyOS through OSLauncher and I either get a blank screen, which won't reboot until I pull out the touchpad, or what happens in the picture attached. It looks like there are two small versions of the screen and then random pixels at the bottom.

If I try to run OS 3.0.1 CAS, it always freezes at the clock screen, or just turns into a blank screen and never even gets to the clock.

This is on OS 3.1.0, BTW.
Spoiler For Spoiler:
Sorry for being inactive, I've been busy  :-\

5
Casio Calculators / Casio's Response to My Suggestions
« on: March 03, 2012, 09:22:03 am »
I emailed the guy that responded to me to give me my free Prizm. Here's (the important part of) what I said:

Quote
1. Support for arbitrary-precision arithmetic. The Nspire family of calculators have this, and it makes them tremendously powerful. I also have an Nspire, and it is a tough decision for me to choose between the two calculators I own because while the Prizm has many advantages over the Nspire, the Prizm cannot perform operations involving very large numbers (say, 23200)
2. Showing what each function in the catalog takes in. When I use the catalog to select a function, I often don't know what inputs I should type in, or the order that they go in. This can become quite frustrating because I would then have to experiment with the function to see how to use it. Reserving a line in the catalog menu to display what inputs a function needs and the order they go in would be very useful.
3. A better font. You might think this is a minor complaint, but the font of a calculator contributes tremendously to the look and feel one gets when using it. I believe the font is too thick (it looks like everything is in bold), and also too large in most places. It also has serifs, which makes the calculator look a bit outdated, and characters such as the lower case "p" don't line up with the rest of the characters. Changing the font to something that is sans-serif and fixes the problems I mentioned would improve the look and feel of the Prizm significantly.
4. Fix the logarithm button. This is only a minor complaint, but pressing the logarithm button will give a log function that doesn't display what base it is in. However, if you go to the math menu, and then logab, you get to specify the base as well, which I prefer.
5. Allow third-party C and assembly development. Not doing so has been TI's greatest mistake, and it is one that you can take advantage of. Allowing third-party development will attract a large audience of programmers to buy the Prizm because they are tired of jumping through so many hoops to develop on the Nspire. The programs they will make will also benefit Casio - believe it or not, many of the programs made for calculators aren't games, but rather extremely powerful utilities that extend the capabilities of the calculator even further! Just look at what TI-84 developers have done over time: they made extremely fast prime factoring programs, added support for arbitrary-precision arithmetic, added the ability to type lowercase letters, and even allowed the calculator to recover from RAM clears! Opening the Prizm to third-party development will make the Prizm even more powerful, and it would be much easier for Casio to release an SDK than it would be to program all the features third-party developers would have added.

Implementing these suggestions, which can be done just through a software update, would make the Prizm a near perfect calculator, and it would be an easy choice for me, as well as others, to pick between this and an Nspire. I truly hope that Casio will listen to these suggestions.
I know the guy I emailed probably wasn't in the programming department of Casio, and that most of their important decisions are probably made in Japan (he's in Washington state), but it was worth a try. I at least got a response! Here's his reply:
Quote
Thanks for your feedback and detailed suggestions.  I'm glad you are enjoying your Prizm and I hope you share the word with other students and teachers; word of mouth is the best way to spread the news.
 
I will certainly pass your suggestions on to those that make the decisions, but wanted to take a minute to respond to a few of your points:
 
1. Arbitrary-precision arithmetic: I admit I'm not familiar with this, but you've piqued my interest.  I will be looking into it.
 
2. Catalog Help: An absolutely fabulous idea -- I don't make these decisions, but I'm going to push for this one.
 
4. The logarithm button: Have you tried the MATH soft-menu in Run-Matrix?  I think this is the button you're speaking about.  From Run-Matrix, just press F4, then F2 and you'll get the log-of-any-base template.
 
5. Third Party C Development: From a certain perspective, I'm totally with you.  I've got some programming background and I've seen what a nice community of modders there is out there.  And it certainly would, as you said, open up our calculator to a great deal of demand.  However...  we're a primarily a provider of calculators to the education market.  Can you imagine how teachers would react if calculators could be modified?  You and I both know that modifications would include things like faking a memory reset or other things that would facilitate cheating.  Until we figure out a way to allow modding AND keep calculators safe for testing purposes, we're at an impasse.
He didn't respond to my suggestion about fonts :( And he says that third-party development won't happen until they can keep it safe for tests  :'( I wonder if my other suggestions, especially catalog help, will be implemented in the next OS update though.

6
TI-Nspire / A New Font for the Nspire!
« on: February 27, 2012, 05:40:59 pm »
I ported the 16 pt variable width Ubuntu Light font over for use in Ndless programs!

ASCII characters 32-117 are supported right now, and I have two versions: a narrower spaced one and a wider spaced one. The screenshot shows the wider spaced one. The wider spaced one gives one more pixel of space between characters. I personally think the spacing should somewhere between the wider and narrower spaced ones, but there are no half pixels... The narrower spacing is also too small for some characters (try k and then a space) and screws them up.

Download the demo (source included) if you want! The character and spacing maps are free for you to use and modify!

In the demo, you can type in the top. Sorry, I didn't spend much time programming the typing, so right now it's not very smooth. Press CTRL to enter caps lock and CTRL again to exit it. Use "-" to lighten the text color and "+" to darken it. Press the multiplication button to darken the background and the division button to make it lighter. Sometimes, the string gets screwed up and it won't display new characters. Just restart the program by pressing escape to exit, and then re-running it.

Note: the demo doesn't run on OS 3. It would be appreciated if someone could compile the program to work for OS 3.

7
Calculator C / Noob Questions about Porting
« on: February 24, 2012, 02:20:42 pm »
I would like to use GMP in an Nspire program. I've experimented with building it a bit, but I really don't know what I am doing. Hopefully these questions don't sound too stupid:
1. If I compile a library and use it in my program, and build my program using nspire-gcc, would the library have to be in a special format so it can be used on Nspires?

2. What do libraries even compile into (in Linux)? I would think that if you included the header file of a library, then when you build your own project, the compiler will see the other files from the library included in it, and compile those as well.

3. If GMP compiles, would it even be in a form that is usable for Nspire applications?

8
Calculator C / Help on My Program
« on: January 15, 2012, 07:25:31 pm »
Hi guys,
It's been a while since I've been on Omnimaga, but now that I have some time, I would like to get back to my program.

Basically, I gave up on it because after I wrote the code for displaying numbers that don't completely fit on the screen, I found that it stopped giving the correct answer at some random number. For example, it can tell me the first and last digits of 2155, but it gives an odd number for 2210, which is clearly not correct. I know that the Nspire isn't running out of RAM, because it's consistently able to make arrays of 18,000,000 chars. I don't know what the problem is, because I don't know why the program would just stop working after some arbitrary number.

Any ideas?

9
Miscellaneous / Anyone do Folding@Home?
« on: September 28, 2011, 04:31:27 pm »
I fold and am currently still on the default team. I just got into the top 200,000, with 35369 points. (yay!) I only fold when I am on or at least am in front of the computer. The only computer that contributes to me is my laptop, one that has an i7-620M (2 cores, 4 threads) and a Nvidia Quadro NVS 3100M. I run the SMP core on my CPU, and unfortunately my GPU is not supported, although it can run CUDA code. (My GPU is so rare that they didn't bother to add it to the compatibility list)

Link to SammyMaX

10
Calculator C / Nspire: Keypad Input
« on: September 06, 2011, 04:11:06 pm »
Since the Nspire is so fast, it is hard to program responsive, but not oversensitive keyboard input. I have a solution to this! (Hopefully you can help improve it too)

From what I've seen in most Ndless programs, the bulk of the main function is in something like this:
Code: [Select]
while(!isKeyPressed(NSPIRE_KEY_ESC))
{
// Code
}
If one just inserts things like if(isKeyPressed(KEY_NSPIRE_ENTER)), a single tap of the enter button may register 10 times, which is really bad if you're trying to type in numbers or words. However, if one does:
Code: [Select]
// Insert whatever value of x below
sleep(x);
if(isKeyPressed(someKey))
{
}
Then low values of x will result in input registering twice or three times, and high values of x resulting in the Nspire detecting nothing at all. I have tried this many times and couldn't find a "magic value" between the two. My new method uses a counter to see how many iterations it has gone through the while loop since the previous key press, and uses idle() instead of sleep(). A key will only register if it has been at least x iterations. In code:
Code: [Select]
// I used 5 as the minimum number of iterations here
int numIterations = 5;
while(!isKeyPressed(NSPIRE_KEY_ESC))
{
  // Optional, but saves power
  idle();
  if(isKeyPressed(someKey) && numIterations == 5)
  {
    numIterations = 0;
    // Stuff
  }
  // Prevents numIterations from going above 5
  if (numIterations < 5)
    numIterations++;
}
Does anyone have any other ideas? What do you do in your Ndless programs?

11
Calculator C / Using Eclipse for Ndless Development/Debugging
« on: September 01, 2011, 05:40:19 pm »
From this hackspire page I see that programs can be built and debugged from Eclipse. However, when I import my project and build it, it uses GCC instead of nspire-gcc. Is it reading my previous makefile at all? How is this fixed?

Edit: Eclipse also can't find os.h, although [ndless directory]/sdk/include is in the path.

12
Other Calculators / Why Do You Program on Your Calculator?
« on: September 01, 2011, 05:13:02 pm »
Hey guys, I'm just curious  ;D
I do it because the computer already has all (most of) the software anyone could ever think of. The calculator front has much more open room for creativity. Another part of it is that the calculator is just so portable and is allowed everywhere (like in classrooms) where computers and phones can't go. It gives me a happy feeling to be able to carry a program I made everywhere, and impress my friends.  :) Finally, things like slow processors and scarce RAM pose an interesting challenge to programmers not found in other platforms.

What do you guys think?

13
Calculator C / Ndless Program Puts Nspire into Load
« on: August 21, 2011, 12:04:13 pm »
My program uses a
Code: [Select]
while (!isKeyPressed(KEY_NSPIRE_ESC)) so it only exits when escape is pressed. This loops causes an annoying clock to appear, indicating heavy processor load, and also wastes battery. I have tried sleep(), but with numbers even as high as 500 milliseconds, the clock still ends up appearing, albeit taking more time to do so. Also, with numbers higher than 100 or so, a noticeable input lag appears. What is the proper way to fix this?

14
Calculator C / Setting Up Ndless C Compiler
« on: August 14, 2011, 12:17:29 pm »
I posted this in the "Tutorial - Setting up C Development Environment for the TI-Nspire" section, but the topic hasn't been active for several months so I started a new one.

Anyways, here's my problem: I've added ...blah/ndless2/sdk/bin to my PATH variable (in Ubuntu) but when after typing in "make" in the hello sample folder, I get this error: "make: execvp: nspire-gcc: Permission denied." If I type in "sudo make", I get "make: nspire-gcc: Command not found." What's wrong?

15
TI-Nspire / BigNumNum Cruncher
« on: August 13, 2011, 04:19:36 pm »
BigNumNum Cruncher is a bignum program for the Nspire, written in C. It should be able to handle numbers as big as the Nspire's RAM allows it to be, with one digit per byte. (This may not mean output being up to (number of available bytes of RAM) digits long, since in the instance 2^1000000, it would need to store 2^999999 to get to 2^1000000) I have finished the addition and multiplication functions, and have the basic GUI going, but a lot of work has to be done (Powers in beta testing for now) I have no school on 9/29/11, so hopefully some major work can be done.

BigNumNum Cruncher originally started in Lua but since then, I have moved over to C, since Lua was far too slow for this program. Numbers are stored in my program as arrays of ints, with only 4 digits able to be used in each int because of overflow. (Perhaps there is a way to fully utilize the RAM and double capacity?)

Spoiler For Changelog:
Version 0.01 Lua with GUI done
Version 0.02 Lua with addition
Version 0.03 Lua with subtraction
Version 0.04 Lua with multiplication and powers
Version 0.05 Lua with bug fixes

Version 0.10 C with GUI and addition
Version 0.11 C with less bugs
Version 0.12 C with multiplication
Version 0.13 C with powers and results less than 37 digits
Version 0.14 C with major speed up in addition and subtraction algorithms
Version 0.15 C major release memory allocation bug fixed

Pages: [1] 2