Author Topic: General Ndless Questions and Support  (Read 105332 times)

0 Members and 1 Guest are viewing this topic.

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: General Ndless Questions and Support
« Reply #135 on: January 21, 2013, 02:01:44 pm »
This code crashes :
Code: [Select]
int main()
{
  char *filename;

  if(show_msg_user_input("A", "B", "C", &filename) != -1) free(filename);
  return 0;
}
It runs fine for me. Update your Ndless (on the handheld) to the latest.

Quote
And I can't find any libndls directory in /ndless/ ... (I use the Ndl3ss SDK)
Okay ... in the sources, so here is the sample code :
Code: [Select]
   const char * title = "Title";
   const char * msg = "Element";
   char * defaultvalue = "default value";
   char * value;
   unsigned len = show_msg_user_input(title, msg, defaultvalue, &value);
   if (len >= 0)
   {
      printf("%s (%d)\n", value, len);
      free(value);
   }
   else
      puts("Canceled");
Quote
EDIT : second question on the go : why does libndls's refresh_osscr() crashes ? :banghead:
Same, I think your Ndless version on the handheld is not up to date.

Indeed, you don't know its size and putting arbitrary size (here 256) is a bad programming behavior.
I don't want to be a nitpicker, but I have to disagree. In a practical context, using "big enough" buffers when dealing with arbitrary-sized strings is in many cases better than hassling around with a bunch of pointers and dynamically allocated memory. Using the latter method complexifies and bloats the code unnecessarily, gives the programmer additional responsibility (gotta compute the size of the data, malloc it, remember to free the memory, etc.), decreases the programs maintainability (as the code for that filename container is scattered around, when modifying bigger chunks better check it doesn't cause any undefined behavior), and generally the whatever academic perfection of the code doesn't outweigh the pain of dealing with such trivial stuff. We're not talking about security-critical government-class programs here, and it's not like there aren't any functions to avoid buffer overflows and whatnot.
I'm not saying you should be using statically allocated data for everything (quite the contrary usually), but for string buffers and such, a char buf[BUF_SIZE]; is usually good enough.
I know, but this applies in a context you can't control the length of the string. Here, the popup does not limit the number of characters entered, and at first it was a 256 buffer. Some people complained because it crashes when you enter a 120 chars string, and indeed ... the popup does not limit it. Thus, without having to allocate a 1024 buffer, I prefer using the dynamic length String API the Nspire uses. I think this API is the only one that runs really nicely compared to a lot of things on Nspire development.
On the other hand, there is a place in the OS where it limits the string length to 256 because the buffer is 256 : The SaveAs popup. And this has sense, I agree.
« Last Edit: January 21, 2013, 02:02:38 pm by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: General Ndless Questions and Support
« Reply #136 on: January 21, 2013, 02:14:59 pm »
I'm using nspire_emu_easy from Ti-Planet, it's a version with Ndl3ss already in it. Do you think it could be the wrong version ?

And there is a SaveAs popup ? O.o I didn't see it.
« Last Edit: January 21, 2013, 02:17:04 pm by Matrefeytontias »

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: General Ndless Questions and Support
« Reply #137 on: January 21, 2013, 02:20:56 pm »
I'm using nspire_emu_easy from Ti-Planet, it's a version with Ndl3ss already in it. Do you think it could be the wrong version ?
I've never heard of that before and I cannot find any archive having this name on TI-Planet.
But yeah, if Ndless is included in the archive, it is surely outdated. Ndless updates syscalls and developments tools in background a lot of times.

Quote
And there is a SaveAs popup ? O.o I didn't see it.
Yes and No. It is a syscall I did not added to Ndless for the moment as it is part of nFrame, still under development.
If you really want it, pick it up from ThemeEditor sources.
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline hoffa

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: General Ndless Questions and Support
« Reply #138 on: January 21, 2013, 06:28:14 pm »
I'm using nspire_emu_easy from Ti-Planet, it's a version with Ndl3ss already in it. Do you think it could be the wrong version ?
I'm pretty sure that's the all-in-one nspire_emu package I made. I think it has an older version of Ndless installed (that did have some issues), so I suggest you download the newest Ndless, install it on the emulator, and save the flash image.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: General Ndless Questions and Support
« Reply #139 on: February 13, 2013, 08:45:14 pm »
Is there an ndless sdk/editor for linux?

Offline stuffstuff

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: General Ndless Questions and Support
« Reply #140 on: September 22, 2013, 12:00:34 am »
I have an nspire cx.
I currently have ndless v1.? (probably 1.0 or 1.1) and haven't updated it since.  Now, I want to get more games such as doom 2, and I want to use nlaunch (or nlaunchy?) to get cas functionality (I don't plan to take the ACT).
Do I need to get ndless 3.1, and should I?  Do I just download os 3.1 from tiplanet and then follow the nspire 3.1 instructions?
Is there any particular order that I should install nlaunch and ndless in?
Do I install nlaunch or nlaunchy?
Is there any way to find all user uploaded games for nspire cx ndless (and can I use games for the regular nspire ndless on the cx?)?

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: General Ndless Questions and Support
« Reply #141 on: September 22, 2013, 01:55:01 am »
Quote
Do I need to get ndless 3.1, and should I?
Ndless 1.0 and 1.1 only work on the oldest OS 1.1 versions, and those are only for the Clickpad models. For a CX / CX CAS calculator, you need OS 3.1.0.392 and Ndless 3.1.

Quote
Do I just download os 3.1 from tiplanet and then follow the nspire 3.1 instructions?
Depends on the manufacturing date and hardware revision of your calculator. It's a group of 1 letter, 4 figures and 1 letter written on the back, at the right of the serial number.
If the last letter of that group is J or higher, you're in trouble: at the time of this writing, there's no way to do anything with those calculators. If it's H or lower, you can downgrade for OS 3.1 to work, either directly (if the calculator's boot2 is 3.10.16) or after reflashing the boot2 through a relatively cheap, widespread but extra equipment known as USB-RS232 TTL adapter.

Quote
Is there any particular order that I should install nlaunch and ndless in?
Yes, it's described in the instructions :)

Quote
Do I install nlaunch or nlaunchy?
nLaunchy is the newer, community-maintained version of nLaunch and nLaunch CX, which were made by unknown author(s).

Quote
Is there any way to find all user uploaded games for nspire cx ndless (and can I use games for the regular nspire ndless on the cx?)?
In the Omnimaga, ticalc.org and TI-Planet archives. There's also a site by compu, but I'm not sure how to date it is.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline stuffstuff

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: General Ndless Questions and Support
« Reply #142 on: September 22, 2013, 12:39:14 pm »
It turns out that I had the right version of ndless already, but when I was installing nlaunchy, it wouldn't work.
I got stuck on step 9 (https://github.com/Excale/nLaunchy), where I had transferred the os, but I was continually rebooting, with no progress (past 60) after 3 minutes, and it said something like PP123... in the top left corner.  Then, after something like 10 tries, I went back to the maintenance menu and deleted the OS again, and now it asks me to install an os every time.  Sometimes it gives me an error, and sometimes it says success, but it always gets me back to the same place, 60%, saying Operating System not found...  How can I fix this?
« Last Edit: September 22, 2013, 02:38:55 pm by stuffstuff »