Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: compu on August 08, 2013, 03:47:05 pm

Title: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 08, 2013, 03:47:05 pm
Hi,
I'm trying to make some kind of package manager for the TI-Nspire.
The goal is to make installing/removing programs on an Nspire very easy, e.g. for games that need a large amount of other files/resources.
In its current state pacspire can install zip files and register file extensions on installation time.

For testing purposes I made a package of Tile World (http://ourl.ca/19149/357172;topicseen#new) which can be installed with one click ;)

To do this, you have to send pacspire.tns and tworld.pcs.tns to your calc and start pacspire once. Now you can click on tworld.pcs.tns to install it.
Source code and more information is available on github (https://github.com/compujuckel/pacspire).
This is an early version so please let me know if you have suggestions, find bugs, etc.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: TheNlightenedOne on August 08, 2013, 05:40:33 pm
Wow :o! Very cool. I'll be trying this next time I use my Nspire.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ajorians on August 08, 2013, 05:55:25 pm
Hey compu,

Nice!  I do find it can take a little bit of time creating the necessary directories and setting up a program.  I've messed up setting up a program a few times and so because a file wasn't found and the way the program was written the calculator restarted.  Hopefully this will fix that!

Keep working on it and adding more features when you can!

Have a great day!
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Sorunome on August 08, 2013, 06:13:02 pm
wait, this is awesome!
a package manager for the nspire O.O
But you need linux, right?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Streetwalrus on August 08, 2013, 06:58:11 pm
Nope, it's for Ndless. :P
It  does sound pretty awesome indeed. ;)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 08, 2013, 07:55:27 pm
So I would have to download the .pcs package manually, transfer it to my calculator and then install it?  :-\

Sure, it's easier to install and you won't make any mistakes, but I think a pc-based version (using tilp's libs) would be better, but also harder to code and maintain.
Imagine a public omnimaga and ti-planet repository with almost every app available as "one-click-install".
Something like an "Nspire-App-Store", maybe even with automated ndless installation?
Maybe even an "One-Click-Update" which updates all applications installed on the calculator..
Maybe my brain is already dreaming at 2:00 am while I'm still awake typing this post..
However, this tool is already waaaaaaayyy more awsome to use than dragging and dropping dozens of files in tilp ;)

Edit: pacspire uses .zip format for the files? What is the installation speed like?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 09, 2013, 03:23:21 am
compu: nice :)
Would being able to temporary unpack/run/remove temporary files be an interesting option, to avoid cluttering the OS file manager at the expense of launch time?
Also how does pacspire conflicts with Ndless's zlib definitions?


Vogtinator: an app store would indeed be a nice way to promote TI-Nspire programs which unfortunately often sink into Omnimaga's topic archives after a few months.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 09, 2013, 03:29:48 am
Yeah, the remote control support in libticalcs (although it's just the mechanics, the key definitions themselves need to be retrieved from TI's software and added to libticalcs as "keysnsp") might prove handy.

An app store would indeed be nice, but who will do the work of setting it up, maintaining it in the long-term, and sifting through old programs for re-packaging them ?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Streetwalrus on August 09, 2013, 03:47:51 am
An app store would indeed be nice, but who will do the work of setting it up, maintaining it in the long-term, and sifting through old programs for re-packaging them ?
Maybe Linux style repos ? This way devs maintain their stuff themselves and it's pretty easy to set up (you just need an HTTP server and there are plenty of free hosts). ;)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 07:10:33 am
So I would have to download the .pcs package manually, transfer it to my calculator and then install it?  :-\
At the moment, yes.

Sure, it's easier to install and you won't make any mistakes, but I think a pc-based version (using tilp's libs) would be better, but also harder to code and maintain.
A PC-based version is at least on my wishlist ;D

Imagine a public omnimaga and ti-planet repository with almost every app available as "one-click-install".
Something like an "Nspire-App-Store", maybe even with automated ndless installation?
Maybe even an "One-Click-Update" which updates all applications installed on the calculator..
Maybe my brain is already dreaming at 2:00 am while I'm still awake typing this post..
Well, I'll see what I can do. :P

Edit: pacspire uses .zip format for the files? What is the installation speed like?
I'm at school now and can't give you exact times, but it is not too slow. Try installing the tworld package (~1,8MB uncompressed, ~400KB compressed) and you'll see.

compu: nice :)
Would being able to temporary unpack/run/remove temporary files be an interesting option, to avoid cluttering the OS file manager at the expense of launch time?
Sure. And by the way, would it be possible to make the program loader of ndless available to launched programs?

Also how does pacspire conflicts with Ndless's zlib definitions?
Everything zlib-related in os.h is commented out at the moment.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 09:09:07 am
An app store would indeed be nice, but who will do the work of setting it up, maintaining it in the long-term, and sifting through old programs for re-packaging them ?
Maybe Linux style repos ? This way devs maintain their stuff themselves and it's pretty easy to set up (you just need an HTTP server and there are plenty of free hosts). ;)
Why not a simple Web UI for submitting and updating apps?

Sure, it's easier to install and you won't make any mistakes, but I think a pc-based version (using tilp's libs) would be better, but also harder to code and maintain.
A PC-based version is at least on my wishlist ;D
Great! If you want to, I could help :D
Quote
Edit: pacspire uses .zip format for the files? What is the installation speed like?
I'm at school now and can't give you exact times, but it is not too slow. Try installing the tworld package (~1,8MB uncompressed, ~400KB compressed) and you'll see.
Wow, not too bad for a calculator..
But if I click on tworld.pcs.tns again, it says 1.3.0 would be newer than my installed version 1.3.0, but in the log file it states otherwise xD
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Eiyeron on August 09, 2013, 09:11:20 am
Will you do the same for other calculator models?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 09, 2013, 09:27:37 am
The [great, in my option] idea of an Nspire App-Store has been in mind of several people for quite some time, yet nothing has been done on that path :P
It could be coupled with some remote control software to automatically extract/isntall/launch whatever. nRemote for example can do that quite easily with its "script" support.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 09:30:18 am
But doesn't nRemote use the mysterious NavNet.jar to interface with the Nspire windows driver?
That would make it completely useless to me, as I'm using Linux.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Streetwalrus on August 09, 2013, 09:32:53 am
But doesn't nRemote use the mysterious NavNet.jar to interface with the Nspire windows driver?
That would make it completely useless to me, as I'm using Linux.
Same here. libti* supports this functionality though as Lionel stated a few posts up. ;)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Hayleia on August 09, 2013, 09:33:26 am
Will you do the same for other calculator models?
Not sure it is a good idea. Take the example of the 83+ (and sorry if I take the examples of my games but those are the ones I think of first).
-To install RainbowDashAttack, you have to send one file. No need for a package installer.
-For Pokemon Topaze, you have to send tons of files. It is not really hard to put them all in archive as the readme says, but maybe you're right, it is easier to put one file in archive. However, that would make a 40KB installer installing 40KB of data. Maybe the installer would "only" take 10KB with utopic-style compression, but that is still 10KB, and in a 83+, that is a lot, so not a good idea.
-other problem: you'll have to compile your installer as an app if you want a lot of data to fit in, and that is not the easiest format to deal with.

I think the Nspire was "chosen" because it (usually) has enough space to support the installer, the package and the installed program at the same time.
that could work for the Prizm too I guess.


Anyways, great work Compu, that will surely help people installing their programs. I think there should be (if not already present) a way to decide if the installation is done in a specified folder (for in-dev programs that still don't support to be in any folder or don't support their dependencies to be in random folders, or for programs that must be in startup) or in a folder that the user would choose (for programs that can be run from any folder and that the user would like to put in the Game folder for example).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 09:36:11 am
An app store would indeed be nice, but who will do the work of setting it up, maintaining it in the long-term, and sifting through old programs for re-packaging them ?
Maybe Linux style repos ? This way devs maintain their stuff themselves and it's pretty easy to set up (you just need an HTTP server and there are plenty of free hosts). ;)
Why not a simple Web UI for submitting and updating apps?
That's what I was thinking of + a command-line client that downloads packages and sends them to the calc (I guess that would be possible with libti*?).

Great! If you want to, I could help :D
Sure, why not :)

Quote
But if I click on tworld.pcs.tns again, it says 1.3.0 would be newer than my installed version 1.3.0, but in the log file it states otherwise xD
Quote from: dialog
The installed version of tworld (1.3.0) is newer than the one you are trying to install (1.3.0). Continue?
Quote from: logfile
checking if the package is newer than the installed version... no
It actually says the same, but "installed version" and "package" are interchanged... I should probably change that :D

The [great, in my option] idea of an Nspire App-Store has been in mind of several people for quite some time, yet nothing has been done on that path :P
It could be coupled with some remote control software to automatically extract/isntall/launch whatever. nRemote for example can do that quite easily with its "script" support.
Thanks, I will take a look at nRemote, but if it doesn't work on Linux as Vogtinator says, it probably won't be an option.

Damn, I was ninja'd 4 times writing this post...

Anyways, great work Compu, that will surely help people installing their programs. I think there should be (if not already present) a way to decide if the installation is done in a specified folder (for in-dev programs that still don't support to be in any folder or don't support their dependencies to be in random folders, or for programs that must be in startup) or in a folder that the user would choose (for programs that can be run from any folder and that the user would like to put in the Game folder for example).
Thanks!
Selecting a folder should be pretty easy to add.

EDIT:
Here is a small gif to show the installation process.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Hayleia on August 09, 2013, 10:50:59 am
Anyways, great work Compu, that will surely help people installing their programs. I think there should be (if not already present) a way to decide if the installation is done in a specified folder (for in-dev programs that still don't support to be in any folder or don't support their dependencies to be in random folders, or for programs that must be in startup) or in a folder that the user would choose (for programs that can be run from any folder and that the user would like to put in the Game folder for example).
Thanks!
Selecting a folder should be pretty easy to add.
Sorry, I may have used too much parentheses or used a not understandable enough English, so there is a part of my request that you didn't see.
-I was indeed asking for a "folder selection menu" or something.
-But also a way for developers to force the "unpacking folder", so that a program that must be put in "startup" will always be put in startup (doesn't ask the user where to unpack), or so that a program that is still in-dev and that must be ran from the Ndless folder (and nowhere else) will be unpacked in the Ndless folder.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 10:54:03 am
Why not a simple Web UI for submitting and updating apps?
That's what I was thinking of + a command-line client that downloads packages and sends them to the calc (I guess that would be possible with libti*?).
I just tried to read the libticalcs2 HTML-documentation and it seems so outdated, that "nspire" isn't mentioned one singe time.
But as tilp runs fine and some files in src begin with nsp_*, I think it's the right library in the right version.
So is tilp the only reliable source for documentation?
And I wonder why there are four libti* librarys. In my opinion it would have made more sense to combine them into one libticalcs..

Quote
Great! If you want to, I could help :D
Sure, why not :)
I'll try setting up a small application which sends a file to the calculator and maybe even executes it.
Quote
The [great, in my option] idea of an Nspire App-Store has been in mind of several people for quite some time, yet nothing has been done on that path :P
It could be coupled with some remote control software to automatically extract/isntall/launch whatever. nRemote for example can do that quite easily with its "script" support.
Thanks, I will take a look at nRemote, but if it doesn't work on Linux as Vogtinator says, it probably won't be an option.
Even with WINE it doesn't. It needs the navnet device driver installed. TINCL shows a splash screen and then it exits with "Connectivity Library is missing".

How should the calculator and the App Store play together? Should the store extract the archive and send all the files or should the appstore send the package to the calculator and start pacspire to install it? The latter sounds better in my opinion, but I think it'll get close to impossible, as pacspire can't communicate with the appstore in any ways except screenshots and files (and that only if no ndless app is running!)  :banghead:
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 11:12:32 am
Sorry, I may have used too much parentheses or used a not understandable enough English, so there is a part of my request that you didn't see.
-I was indeed asking for a "folder selection menu" or something.
-But also a way for developers to force the "unpacking folder", so that a program that must be put in "startup" will always be put in startup (doesn't ask the user where to unpack), or so that a program that is still in-dev and that must be ran from the Ndless folder (and nowhere else) will be unpacked in the Ndless folder.
forcing an installation folder is easy as well and could be added to the pkginfo.txt, but I'd like to have another solution:
Putting all resources/executables in one central folder with subdirectories for each package (that could be outside of the /documents/ folder) and put something like shortcuts into the Documents folder.
The same could be done with the startup folder: just put a shortcut in there and it wouldn't matter where the program is actually located.
Since r820 Ndless has the function enable_relative_paths() so programs shouldn't care about the location of their resources (as long as programs are adapted to use this function, which is pretty easy).
Well, let me know what you think. But I think this would be easier when we are turning pacspire into a fully-fledged package manager.

I just tried to read the libticalcs2 HTML-documentation and it seems so outdated, that "nspire" isn't mentioned one singe time.
But as tilp runs fine and some files in src begin with nsp_*, I think it's the right library in the right version.
So is tilp the only reliable source for documentation?
And I wonder why there are four libti* librarys. In my opinion it would have made more sense to combine them into one libticalcs..
Yup, I only found outdated documentations as well. Maybe, Lionel, if you are reading this... :P

Quote
I'll try setting up a small application which sends a file to the calculator and maybe even executes it.
Nice :)

Quote
Even with WINE it doesn't. It needs the navnet device driver installed. TINCL shows a splash screen and then it exits with "Connectivity Library is missing".
:/

Quote
How should the calculator and the App Store play together? Should the store extract the archive and send all the files or should the appstore send the package to the calculator and start pacspire to install it? The latter sounds better in my opinion, but I think it'll get close to impossible, as pacspire can't communicate with the appstore in any ways except screenshots and files (and that only if no ndless app is running!)  :banghead:
I'd let pacspire do the work. Some posts ago Lionel said libticalcs has support to send keystrokes, maybe that would work somehow? ;D
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 09, 2013, 11:22:44 am
But doesn't nRemote use the mysterious NavNet.jar to interface with the Nspire windows driver?
That would make it completely useless to me, as I'm using Linux.
But doesn't nRemote use the mysterious NavNet.jar to interface with the Nspire windows driver?
That would make it completely useless to me, as I'm using Linux.
Same here. libti* supports this functionality though as Lionel stated a few posts up. ;)

Yes sure, but at least it will function directly and more quickly (no install time, I mean) for those on windows (and mac) with TINC[L]S installed, with no need of filter driver and such because of that crappy windows roadblock...
For Linux obviously libti* is the choice as it's easy to use there (and, well, is the only one).
Remember the main point here, whatever the choice : it has to be extremely simple for the user (no installation would be great)

And, also, let's not forget that if such App-Store project comes to life, it'll have to be for all .tns of course (there are tons of TI activities that could use this, but also Lua scripts, and duh, the ndless programs (especially those with external resources), so if it ever gets popular (who knows :P), the majority of users will be PC, then Mac, then Linux (and the order of file type will be TI BASIC things, then the Lua stuff, then the ndless stuff...)

Also, it'd be good to have such a program linked to the major community repos (ticalc, omni, tiplanet, cemetech...)

Anyway, interesting ideas :)


Also : nice gif compu :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 09, 2013, 11:30:36 am
Quote
So is tilp the only reliable source for documentation?
The documentation of libti* was already incomplete / partially outdated when I became the maintainer, and (with the help of contributors) I have focused more on the code (which needs bugfixes, feature expansion and hardening) than on the documentation (all the more libti* have relatively few users, and documentation of the API has pretty little user-visible effect, eh ?), so yeah, the source code of the libraries and testcases is your best bet. You're coders as well, after all ;)
Have a look at libticalcs (calc_xx -> calc_nsp -> nsp_cmd -> nsp_vpkt -> nsp_rpkt) and the testcase, libticables (link_xxx -> link_usb) and the testcase, TILP (especially tilp_calcs.c), titools. The testcases and titools are about as bare-bones as you can get.

One of the NavNet JARs (don't remember which one) contains the 3-byte key code definitions. Adriweb, remind us which one ;)
BTW, libticalcs contained support for Nspire remote control before nRemote was released, though I used a beta version of nRemote in a Windows VM to debug and fix my implementation of the feature through sniffing USB packets.

Quote
And I wonder why there are four libti* libraries.
Actually, for the combination of TI-Z80, TI-68k and Nspire, four libraries is not enough ;)
There's a clear need for a fifth library on top of the four current ones, so as to consolidate some code currently duplicated, with variations, across clients (TILP, TIEmu, TilEm, titools). I started creating it locally, though it contains pretty little.
The whole libti* framework looks complex and seems to have deep nesting of functions, but after a while maintaining the code base, I realized that for the purposes of presenting a single, mildly abstracted API to clients (instead of at least three sets of APIs with significant overlap, due to TI-Z80/TI-68k/Nspire, DBUS/DUSB/NSP, and some commonalities between TI-Z80 and TI-68k), it's not easy to do simpler. Just follow the call chains I outlined above - there's a use for each file, in the complete framework :)

Quote
In my opinion it would have made more sense to combine them into one libticalcs.
It's equally clear that for the narrower purposes of interacting with the sole Nspire series, four libraries are far too much, and you're completely right about a single library making sense:
* libticonv deals with character conversion, which is necessary on TI-Z80 and TI-68k models, but the Nspire uses Unicode (and conversions can be handled more directly by other frameworks);
* libtifiles deals with file types... but the Nspire has very few of them, unlike the TI-Z80 and TI-68k series;
* libticables deals with multiple cables... most of which don't work on modern computers due to lack of the physical interfaces, and the Nspire uses a single cable type;
* libticalcs deals with the raw DBUS, DUSB and NSP protocols and transport protocols built on top of them.

On my Github, you'll find a one-off experiment of a few hours, where I fused libticonv, libtifiles, libticables, libticalcs and tilp into a single code base (I probably should have let libti* on the one side and tilp on the other side, but oh well), shaved most code related to TI-Z80 and TI-68k calculators. Doing so slashed the size of the code base by more than half (~78K RLOC -> <35K RLOC). I didn't bother thoroughly purging the code base, there remain some bits directly aimed at TI-Z80 or TI-68k series and some APIs which are not necessary for dealing with the Nspire series.
I didn't merge developments from mainline since I created that one-off experiment. With several months of full-time paid work, it would be possible to make a fresh API, simplified from the current one while keeping the good bits, tailored to Nspire interaction, replacing Glib with C++11/STL, making a whole new Qt UI on top of it (GTK+ is falling out of favor), making a solid up-to-date documentation, etc... but who can afford that kind of luxury, all the more it's for the benefit of relatively few users ? At least, I cannot ;)

Quote
Even with WINE it doesn't.
USB support in Wine is in the "TODO" group, anyway.

Quote
Remember the main point here, whatever the choice : it has to be extremely simple for the user (no installation would be great)
Well, the "no installation" part is not going to happen, especially on Windows, due to the "everything USB needs a driver, which in turns requires admin privileges for installing" behaviour. On the day the two main FLOSS Web browsers (Firefox and Chrome) start providing an interface to USB peripherals on the host (notwithstanding the severe security problems), maybe...
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 11:48:30 am
Thanks for the explanation :)

Vogtinator:
get_event() will be helpful. (http://hackspire.unsads.com/wiki/index.php/Libndls#Keyboard )
It receives keystrokes AND you can receive files while waiting for an event to happen. Pretty awesome and it should solve many problems :D

Test attached. It waits for an event and prints the event data (through serial). If you send a file while waiting, it will be received successfully. (Press ESC to close)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Jim Bauwens on August 09, 2013, 12:24:22 pm
Attached to this post you can find NspireHub and TinyWeb. Nspire hub is a Linux application using libti* to communicate with your TI-Nspire. It allows you to send files, keypresses and capture screenshots. It provides some "wrappers" for simple Lua scripts (you run ./nspirelink yourluascript.lua) to allow simple applications. At the moment it contains a script that provides support for TinyWeb. TinyWeb is a (pure) Nspire Lua web browser. At the moment it's not really stable software, but is perfect to demostrate what you can do. It incorporates 1) sending a request to the computer 2) receiving data back 3) receiving the html file converted to a tns 4) parsing the file and displaying the file.

So, I hope the code will help you take advantage of libti* and make an awesome package manager :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 09, 2013, 12:34:37 pm
One of the NavNet JARs (don't remember which one) contains the 3-byte key code definitions. Adriweb, remind us which one ;)
I... don't remember off the top of my head, but I've read here and there it can be in commproxy.jar ; seems about right. (then, a class like NspireVirtualKeyStroke )

BTW, libticalcs contained support for Nspire remote control before nRemote was released, though I used a beta version of nRemote in a Windows VM to debug and fix my implementation of the feature through sniffing USB packets.
Well, it's not as if it was a competition :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Jim Bauwens on August 09, 2013, 12:38:16 pm
You (mostly) don't need the 3-byte key code definition. You can just send ascii, as shown in my code ;)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 09, 2013, 12:38:54 pm
You don't need the 3-Byte key code definition. You can just send ascii, as shown in my code ;)
Yes, but in case you want to actually send nspire-related keystrokes :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Jim Bauwens on August 09, 2013, 12:43:20 pm
Well yeah, that's true.

In that case, here are the codes
Spoiler For Spoiler:
Code: [Select]
private static final byte[] ESC_KEY_BYTES = { 27, -106, 0 };
 private static final byte[] CTRL_ESC_KEY_BYTES = { 0, -17, 0 };

 private static final byte[] TAB_KEY_BYTES = { 9, -107, 0 };
 private static final byte[] SHIFT_TAB_KEY_BYTES = { 124, -107, 0 };
 private static final byte[] CTRL_TAB_KEY_BYTES = { 0, -19, 0 };

 private static final byte[] HOME_KEY_BYTES = { 0, -3, 0 };
 private static final byte[] CTRL_HOME_KEY_BYTES = { 0, -2, 0 };

 private static final byte[] MENU_KEY_BYTES = { 0, 54, 0 };
 private static final byte[] CTRL_MENU_KEY_BYTES = { 0, -50, 0 };
 private static final byte[] MOUSE_CONTEXT_MENU_KEY_BYTES = { 0, -96, 0 };

 private static final byte[] CLICK_KEY_BYTES = { 0, -83, 0 };
 private static final byte[] CTRL_CLICK_KEY_BYTES = { 0, -84, 0 };
 private static final byte[] SHIFT_GRAB_KEY_BYTES = { 0, -7, 0 };

 private static final byte[] LEFT_KEY_BYTES = { 0, 7, 0 };
 private static final byte[] SHIFT_LEFT_KEY_BYTES = { 0, -15, 0 };
 private static final byte[] SHIFT_HOLD_LEFT_KEY_BYTES = { 0, 7, 3 };
 private static final byte[] CTRL_LEFT_KEY_BYTES = { 0, -38, 0 };

 private static final byte[] RIGHT_KEY_BYTES = { 0, 39, 0 };
 private static final byte[] SHIFT_RIGHT_KEY_BYTES = { 0, -14, 0 };
 private static final byte[] SHIFT_HOLD_RIGHT_KEY_BYTES = { 0, 39, 3 };
 private static final byte[] CTRL_RIGHT_KEY_BYTES = { 0, -37, 0 };

 private static final byte[] UP_KEY_BYTES = { 0, 23, 0 };
 private static final byte[] SHIFT_UP_KEY_BYTES = { 0, -13, 0 };
 private static final byte[] SHIFT_HOLD_UP_KEY_BYTES = { 0, 23, 3 };
 private static final byte[] CTRL_UP_KEY_BYTES = { 0, -36, 0 };

 private static final byte[] DOWN_KEY_BYTES = { 0, 55, 0 };
 private static final byte[] SHIFT_DOWN_KEY_BYTES = { 0, -12, 0 };
 private static final byte[] SHIFT_HOLD_DOWN_KEY_BYTES = { 0, 55, 3 };
 private static final byte[] CTRL_DOWN_KEY_BYTES = { 0, -35, 0 };

 private static final byte[] EQUAL_KEY_BYTES = { 61, 117, 0 };
 private static final byte[] CTRL_EQUAL_KEY_BYTES = { 0, -23, 0 };

 private static final byte[] SUCH_THAT_KEY_BYTES = { 124, -19, 0 };

 private static final byte[] A_KEY_BYTES = { 97, 102, 0 };
 private static final byte[] SHIFT_A_KEY_BYTES = { 65, 102, 0 };
 private static final byte[] CTRL_A_KEY_BYTES = { 97, 102, 0 };

 private static final byte[] B_KEY_BYTES = { 98, 70, 0 };
 private static final byte[] SHIFT_B_KEY_BYTES = { 66, 70, 0 };
 private static final byte[] CTRL_B_KEY_BYTES = { 2, -79, 0 };

 private static final byte[] C_KEY_BYTES = { 99, 38, 0 };
 private static final byte[] SHIFT_C_KEY_BYTES = { 67, 38, 0 };
 private static final byte[] CTRL_C_KEY_BYTES = { 3, -78, 0 };

 private static final byte[] FLAG_KEY_BYTES = { 0, -89, 0 };
 private static final byte[] CTRL_FLAG_KEY_BYTES = { 0, -8, 0 };

 private static final byte[] LESS_THAN_KEY_BYTES = { 60, -90, 0 };
 private static final byte[] CTRL_LESS_THAN_KEY_BYTES = { 0, -49, 0 };

 private static final byte[] D_KEY_BYTES = { 100, -123, 0 };
 private static final byte[] SHIFT_D_KEY_BYTES = { 68, -123, 0 };
 private static final byte[] CTRL_D_KEY_BYTES = { 4, -77, 0 };

 private static final byte[] E_KEY_BYTES = { 101, 101, 0 };
 private static final byte[] SHIFT_E_KEY_BYTES = { 69, 101, 0 };
 private static final byte[] CTRL_E_KEY_BYTES = { 5, -76, 0 };

 private static final byte[] F_KEY_BYTES = { 102, 69, 0 };
 private static final byte[] SHIFT_F_KEY_BYTES = { 70, 69, 0 };
 private static final byte[] CTRL_F_KEY_BYTES = { 6, -75, 0 };

 private static final byte[] G_KEY_BYTES = { 103, 37, 0 };
 private static final byte[] SHIFT_G_KEY_BYTES = { 71, 37, 0 };
 private static final byte[] CTRL_G_KEY_BYTES = { 7, -74, 0 };

 private static final byte[] TILDE_KEY_BYTES = { 39, -11, 0 };
 private static final byte[] CTRL_TILDE_KEY_BYTES = { 36, 5, 0 };

 private static final byte[] GREATER_THAN_KEY_BYTES = { 62, -122, 0 };
 private static final byte[] CTRL_GREATER_THAN_KEY_BYTES = { 0, -34, 0 };

 private static final byte[] H_KEY_BYTES = { 104, -124, 0 };
 private static final byte[] SHIFT_H_KEY_BYTES = { 72, -124, 0 };
 private static final byte[] CTRL_H_KEY_BYTES = { 8, -73, 0 };

 private static final byte[] I_KEY_BYTES = { 105, 100, 0 };
 private static final byte[] SHIFT_I_KEY_BYTES = { 73, 100, 0 };
 private static final byte[] CTRL_I_KEY_BYTES = { 9, -72, 0 };

 private static final byte[] J_KEY_BYTES = { 106, 68, 0 };
 private static final byte[] SHIFT_J_KEY_BYTES = { 74, 68, 0 };
 private static final byte[] CTRL_J_KEY_BYTES = { 10, -71, 0 };

 private static final byte[] K_KEY_BYTES = { 107, 36, 0 };
 private static final byte[] SHIFT_K_KEY_BYTES = { 75, 36, 0 };
 private static final byte[] CTRL_K_KEY_BYTES = { 11, -70, 0 };

 private static final byte[] QUOTE_KEY_BYTES = { 34, -95, 0 };

 private static final byte[] IMAGINARY_KEY_BYTES = { 0, -94, 0 };
 private static final byte[] CTRL_IMAGINARY_KEY_BYTES = { 0, -95, 0 };

 private static final byte[] L_KEY_BYTES = { 108, -125, 0 };
 private static final byte[] SHIFT_L_KEY_BYTES = { 76, -125, 0 };
 private static final byte[] CTRL_L_KEY_BYTES = { 12, -69, 0 };

 private static final byte[] M_KEY_BYTES = { 109, 99, 0 };
 private static final byte[] SHIFT_M_KEY_BYTES = { 77, 99, 0 };
 private static final byte[] CTRL_M_KEY_BYTES = { 13, -68, 0 };

 private static final byte[] N_KEY_BYTES = { 110, 67, 0 };
 private static final byte[] SHIFT_N_KEY_BYTES = { 78, 67, 0 };
 private static final byte[] CTRL_N_KEY_BYTES = { 14, -67, 0 };

 private static final byte[] O_KEY_BYTES = { 111, 35, 0 };
 private static final byte[] SHIFT_O_KEY_BYTES = { 79, 35, 0 };
 private static final byte[] CTRL_O_KEY_BYTES = { 15, -66, 0 };

 private static final byte[] COLON_KEY_BYTES = { 58, 1, 0 };
 private static final byte[] CTRL_COLON_KEY_BYTES = { 59, 2, 0 };

 private static final byte[] EXP_KEY_BYTES = { 0, -92, 0 };

 private static final byte[] P_KEY_BYTES = { 112, -126, 0 };
 private static final byte[] SHIFT_P_KEY_BYTES = { 80, -126, 0 };
 private static final byte[] CTRL_P_KEY_BYTES = { 16, -65, 0 };

 private static final byte[] Q_KEY_BYTES = { 113, 98, 0 };
 private static final byte[] SHIFT_Q_KEY_BYTES = { 81, 98, 0 };
 private static final byte[] CTRL_Q_KEY_BYTES = { 17, -64, 0 };

 private static final byte[] R_KEY_BYTES = { 114, 66, 0 };
 private static final byte[] SHIFT_R_KEY_BYTES = { 82, 66, 0 };
 private static final byte[] CTRL_R_KEY_BYTES = { 18, -63, 0 };

 private static final byte[] S_KEY_BYTES = { 115, 34, 0 };
 private static final byte[] SHIFT_S_KEY_BYTES = { 83, 34, 0 };
 private static final byte[] CTRL_S_KEY_BYTES = { 19, -62, 0 };

 private static final byte[] QUESTION_MARK_KEY_BYTES = { 63, 3, 0 };
 private static final byte[] CTRL_QUESTION_MARK_KEY_BYTES = { 0, -53, 0 };

 private static final byte[] PI_KEY_BYTES = { 0, -93, 0 };
 private static final byte[] CTRL_PI_KEY_BYTES = { 0, -12, 0 };

 private static final byte[] T_KEY_BYTES = { 116, -127, 0 };
 private static final byte[] SHIFT_T_KEY_BYTES = { 84, -127, 0 };
 private static final byte[] CTRL_T_KEY_BYTES = { 20, -61, 0 };

 private static final byte[] U_KEY_BYTES = { 117, 97, 0 };
 private static final byte[] SHIFT_U_KEY_BYTES = { 85, 97, 0 };
 private static final byte[] CTRL_U_KEY_BYTES = { 21, -60, 0 };

 private static final byte[] V_KEY_BYTES = { 118, 65, 0 };
 private static final byte[] SHIFT_V_KEY_BYTES = { 86, 65, 0 };
 private static final byte[] CTRL_V_KEY_BYTES = { 22, -59, 0 };

 private static final byte[] W_KEY_BYTES = { 119, 33, 0 };
 private static final byte[] SHIFT_W_KEY_BYTES = { 87, 33, 0 };
 private static final byte[] CTRL_W_KEY_BYTES = { 23, -58, 0 };

 private static final byte[] COMMA_KEY_BYTES = { 44, -96, 0 };

 private static final byte[] THETA_KEY_BYTES = { -120, 6, 0 };

 private static final byte[] X_KEY_BYTES = { 120, -128, 0 };
 private static final byte[] SHIFT_X_KEY_BYTES = { 88, -128, 0 };
 private static final byte[] CTRL_X_KEY_BYTES = { 24, -57, 0 };

 private static final byte[] Y_KEY_BYTES = { 121, 96, 0 };
 private static final byte[] SHIFT_Y_KEY_BYTES = { 89, 96, 0 };
 private static final byte[] CTRL_Y_KEY_BYTES = { 25, -56, 0 };

 private static final byte[] Z_KEY_BYTES = { 122, 64, 0 };
 private static final byte[] SHIFT_Z_KEY_BYTES = { 90, 64, 0 };
 private static final byte[] CTRL_Z_KEY_BYTES = { 26, -55, 0 };

 private static final byte[] SPACE_KEY_BYTES = { 32, 32, 0 };
 private static final byte[] CTRL_SPACE_KEY_BYTES = { 0, -51, 0 };

 private static final byte[] NEW_LINE_KEY_BYTES = { 0, 10, 0 };

 private static final byte[] CTRL_KEY_BYTES = { 0, -86, 4 };
 private static final byte[] SHIFT_KEY_BYTES = { 0, -85, 3 };
 private static final byte[] CTRL_SHIFT_KEY_BYTES = { 0, -85, 7 };

 private static final byte[] BACK_SPACE_KEY_BYTES = { 8, 21, 0 };
 private static final byte[] SHIFT_BACK_SPACE_KEY_BYTES = { 8, 21, 0 };
 private static final byte[] CTRL_BACK_SPACE_KEY_BYTES = { 0, -29, 4 };

 private static final byte[] VAR_KEY_BYTES = { 0, -81, 0 };
 private static final byte[] CTRL_VAR_KEY_BYTES = { 0, -88, 0 };

 private static final byte[] LEFT_PARENTHESES_KEY_BYTES = { 40, 85, 0 };
 private static final byte[] CTRL_LEFT_PARENTHESES_KEY_BYTES = { 0, -25, 0
};

 private static final byte[] RIGHT_PARENTHESES_KEY_BYTES = { 41, 53, 0 };
 private static final byte[] CTRL_RIGHT_PARENTHESES_KEY_BYTES = { 0, -27,
0 };

 private static final byte[] CATALOG_KEY_BYTES = { 0, -111, 0 };
 private static final byte[] CTRL_CATALOG_KEY_BYTES = { 0, -18, 0 };

 private static final byte[] POWER_KEY_BYTES = { 94, -109, 0 };
 private static final byte[] CTRL_POWER_KEY_BYTES = { 0, -21, 0 };

 private static final byte[] SIN_KEY_BYTES = { 0, 116, 0 };
 private static final byte[] CTRL_SIN_KEY_BYTES = { 0, -24, 0 };

 private static final byte[] COS_KEY_BYTES = { 0, 84, 0 };
 private static final byte[] CTRL_COS_KEY_BYTES = { 0, -26, 0 };

 private static final byte[] TAN_KEY_BYTES = { 0, 52, 0 };
 private static final byte[] CTRL_TAN_KEY_BYTES = { 0, -28, 0 };

 private static final byte[] SLASH_KEY_BYTES = { 47, 20, 0 };
 private static final byte[] CTRL_SLASH_KEY_BYTES = { 0, -30, 0 };

 private static final byte[] SQUARE_KEY_BYTES = { 0, -109, 0 };
 private static final byte[] CTRL_SQUARE_KEY_BYTES = { 0, -110, 0 };

 private static final byte[] SEVEN_KEY_BYTES = { 55, 113, 0 };
 private static final byte[] CTRL_SEVEN_KEY_BYTES = { 0, -41, 0 };

 private static final byte[] EIGHT_KEY_BYTES = { 56, 81, 0 };
 private static final byte[] CTRL_EIGHT_KEY_BYTES = { 0, -40, 0 };

 private static final byte[] NINE_KEY_BYTES = { 57, 49, 0 };
 private static final byte[] CTRL_NINE_KEY_BYTES = { 0, -39, 0 };

 private static final byte[] TIMES_KEY_BYTES = { 42, 19, 0 };
 private static final byte[] CTRL_TIMES_KEY_BYTES = { 0, -31, 0 };

 private static final byte[] TEN__POWER_KEY_BYTES = { 0, -20, 0 };
 private static final byte[] CTRL_TEN_POWE_KEY_BYTES = { 0, -108, 0 };

 private static final byte[] FOUR_KEY_BYTES = { 52, 114, 0 };
 private static final byte[] CTRL_FOUR_KEY_BYTES = { 0, -44, 0 };

 private static final byte[] FIVE_KEY_BYTES = { 53, 82, 0 };
 private static final byte[] CTRL_FIVE_KEY_BYTES = { 0, -43, 0 };

 private static final byte[] SIX_KEY_BYTES = { 54, 50, 0 };
 private static final byte[] CTRL_SIX_KEY_BYTES = { 0, -42, 0 };

 private static final byte[] MINUS_KEY_BYTES = { 45, 18, 0 };
 private static final byte[] CTRL_MINUS_KEY_BYTES = { 0, -32, 0 };

 private static final byte[] E_POWER_KEY_BYTES = { 0, -54, 0 };
 private static final byte[] CTRL_E_POWER_KEY_BYTES = { 0, -87, 0 };

 private static final byte[] ONE_KEY_BYTES = { 49, 115, 0 };
 private static final byte[] CTRL_ONE_KEY_BYTES = { 0, -47, 0 };

 private static final byte[] TWO_KEY_BYTES = { 50, 83, 0 };
 private static final byte[] CTRL_TWO_KEY_BYTES = { 0, -46, 0 };

 private static final byte[] THREE_KEY_BYTES = { 51, 51, 0 };
 private static final byte[] CTRL_THREE_KEY_BYTES = { 0, -45, 0 };

 private static final byte[] PLUS_KEY_BYTES = { 43, 17, 0 };
 private static final byte[] CTRL_PLUS_KEY_BYTES = { 0, -33, 0 };

 private static final byte[] ON_KEY_BYTES = { 0, 11, 0 };
 private static final byte[] CTRL_ON_KEY_BYTES = { 0, -16, 0 };

 private static final byte[] ZERO_KEY_BYTES = { 48, 80, 0 };
 private static final byte[] CTRL_ZERO_KEY_BYTES = { 0, -48, 0 };

 private static final byte[] POINT_KEY_BYTES = { 46, 112, 0 };

 private static final byte[] NEG_KEY_BYTES = { -79, 48, 0 };
 private static final byte[] CTRL_NEG_KEY_BYTES = { 0, -82, 0 };

 private static final byte[] ENTER_KEY_BYTES = { 13, 16, 0 };
 private static final byte[] CTRL_ENTER_KEY_BYTES = { 0, -90, 0 };
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 12:49:54 pm
But doesn't nRemote use the mysterious NavNet.jar to interface with the Nspire windows driver?
That would make it completely useless to me, as I'm using Linux.
But doesn't nRemote use the mysterious NavNet.jar to interface with the Nspire windows driver?
That would make it completely useless to me, as I'm using Linux.
Same here. libti* supports this functionality though as Lionel stated a few posts up. ;)

Yes sure, but at least it will function directly and more quickly (no install time, I mean) for those on windows (and mac) with TINC[L]S installed, with no need of filter driver and such because of that crappy windows roadblock...
For Linux obviously libti* is the choice as it's easy to use there (and, well, is the only one).
Remember the main point here, whatever the choice : it has to be extremely simple for the user (no installation would be great)

I think the requirement to have tilp installed is as easy for the average windows user as having the TI software.

With the big advantage of not having a 42th abstraction over the real communication.
Quote
And, also, let's not forget that if such App-Store project comes to life, it'll have to be for all .tns of course (there are tons of TI activities that could use this, but also Lua scripts, and duh, the ndless programs (especially those with external resources), so if it ever gets popular (who knows :P), the majority of users will be PC, then Mac, then Linux (and the order of file type will be TI BASIC things, then the Lua stuff, then the ndless stuff...)

For a real package manager (like pacspire  ;) ) every file is just a file, nothing special (except the metadata, of course).
Quote

Also, it'd be good to have such a program linked to the major community repos (ticalc, omni, tiplanet, cemetech...)
Oh, that wouldn't be a good idea. I prefer having a single repo. Fetching packages and metadata would get horribly slow and what is with different version (but same version number!) of the same app in two repos?

Quote
So is tilp the only reliable source for documentation?
The documentation of libti* was already incomplete / partially outdated when I became the maintainer, and (with the help of contributors) I have focused more on the code (which needs bugfixes, feature expansion and hardening) than on the documentation (all the more libti* have relatively few users, and documentation of the API has pretty little user-visible effect, eh ?), so yeah, the source code of the libraries and testcases is your best bet. You're coders as well, after all ;)

Oh, the usual fear of documentation :P
Quote

Have a look at libticalcs (calc_xx -> calc_nsp -> nsp_cmd -> nsp_vpkt -> nsp_rpkt) and the testcase, libticables (link_xxx -> link_usb) and the testcase, TILP (especially tilp_calcs.c), titools. The testcases and titools are about as bare-bones as you can get.

That's good, although some things like
Code: [Select]
#define TRYF(x) { int aaa_; if((aaa_ = (x))) return aaa_; }can already be called obfuscation :P

Does "ticalcs_calc_execute" still work for nspires? That would be perfect, escpecially if you can pass arguments!
Quote

One of the NavNet JARs (don't remember which one) contains the 3-byte key code definitions. Adriweb, remind us which one ;)

It's c:/Program Files (x86)/TI Education/TI-Nspire Computer Link/lib/commproxy/commproxy.jar /com/ti/et/education/commproxy/NspireVirtualKeyStroke.java
Quote

BTW, libticalcs contained support for Nspire remote control before nRemote was released, though I used a beta version of nRemote in a Windows VM to debug and fix my implementation of the feature through sniffing USB packets.

Oh, I don't think sending keys is a good solution. What if the user presses a key manually or disconnects the calc?
Quote

Quote
And I wonder why there are four libti* libraries.
Actually, for the combination of TI-Z80, TI-68k and Nspire, four libraries is not enough ;)
There's a clear need for a fifth library on top of the four current ones, so as to consolidate some code currently duplicated, with variations, across clients (TILP, TIEmu, TilEm, titools). I started creating it locally, though it contains pretty little.
The whole libti* framework looks complex and seems to have deep nesting of functions, but after a while maintaining the code base, I realized that for the purposes of presenting a single, mildly abstracted API to clients (instead of at least three sets of APIs with significant overlap, due to TI-Z80/TI-68k/Nspire, DBUS/DUSB/NSP, and some commonalities between TI-Z80 and TI-68k), it's not easy to do simpler. Just follow the call chains I outlined above - there's a use for each file, in the complete framework :)

Quote
In my opinion it would have made more sense to combine them into one libticalcs.
It's equally clear that for the narrower purposes of interacting with the sole Nspire series, four libraries are far too much, and you're completely right about a single library making sense:
* libticonv deals with character conversion, which is necessary on TI-Z80 and TI-68k models, but the Nspire uses Unicode (and conversions can be handled more directly by other frameworks);
* libtifiles deals with file types... but the Nspire has very few of them, unlike the TI-Z80 and TI-68k series;
Why seperate conversion from file types?
Quote
* libticables deals with multiple cables... most of which don't work on modern computers due to lack of the physical interfaces, and the Nspire uses a single cable type;
* libticalcs deals with the raw DBUS, DUSB and NSP protocols and transport protocols built on top of them.
Why seperate libticables from libticalcs? Calcs without cables don't work :P
Quote

On my Github, you'll find a one-off experiment of a few hours, where I fused libticonv, libtifiles, libticables, libticalcs and tilp into a single code base (I probably should have let libti* on the one side and tilp on the other side, but oh well), shaved most code related to TI-Z80 and TI-68k calculators. Doing so slashed the size of the code base by more than half (~78K RLOC -> <35K RLOC). I didn't bother thoroughly purging the code base, there remain some bits directly aimed at TI-Z80 or TI-68k series and some APIs which are not necessary for dealing with the Nspire series.
I didn't merge developments from mainline since I created that one-off experiment. With several months of full-time paid work, it would be possible to make a fresh API, simplified from the current one while keeping the good bits, tailored to Nspire interaction, replacing Glib with C++11/STL, making a whole new Qt UI on top of it (GTK+ is falling out of favor), making a solid up-to-date documentation, etc... but who can afford that kind of luxury, all the more it's for the benefit of relatively few users ? At least, I cannot ;)
The code base is too huge too be maintainable.. A complete rewrite would take years, though.
Quote
Quote
Even with WINE it doesn't.
USB support in Wine is in the "TODO" group, anyway.
What means: It's finished in two years but every second application will crash horribly. At least it's my current wine experience..
Quote
Quote
Remember the main point here, whatever the choice : it has to be extremely simple for the user (no installation would be great)
Well, the "no installation" part is not going to happen, especially on Windows, due to the "everything USB needs a driver, which in turns requires admin privileges for installing" behaviour. On the day the two main FLOSS Web browsers (Firefox and Chrome) start providing an interface to USB peripherals on the host (notwithstanding the severe security problems), maybe...
Browsers having USB support? Why not integrate firefox in the linux kernel and booting firefox directly?  <_<
Vogtinator:
get_event() will be helpful. (http://hackspire.unsads.com/wiki/index.php/Libndls#Keyboard )
It receives keystrokes AND you can receive files while waiting for an event to happen. Pretty awesome and it should solve many problems :D

Test attached. It waits for an event and prints the event data (through serial). If you send a file while waiting, it will be received successfully. (Press ESC to close)
The problem is more the other direction.. How do you get feedback from the calc(whether the installation has finished successfully, the ndless version..)?
Reading a logfile (after executing pacspire) would -again- be slow as hell.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 12:58:49 pm
Thanks Jim for the code :)

Quote
Oh, I don't think sending keys is a good solution. What if the user presses a key manually or disconnects the calc?
Well, we could... disable bus access to the keypad while receiving stuff? ;D

Quote
The problem is more the other direction.. How do you get feedback from the calc(whether the installation has finished successfully, the ndless version..)?
Reading a logfile (after executing pacspire) would -again- be slow as hell.
True. How does nRemote receive data from a calc?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Jim Bauwens on August 09, 2013, 01:06:40 pm
nRemote or NspireHub take screenshots and decode pixels that represent data (that we put there at 0,0 absolute position of the display). It then sends a trigger to the calc to let know that it received the data.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 09, 2013, 01:15:36 pm
Quote
Quote
Also, it'd be good to have such a program linked to the major community repos (ticalc, omni, tiplanet, cemetech...)
Oh, that wouldn't be a good idea. I prefer having a single repo.
Yeah, a single repo is less of a maintenance problem.

Quote
That's good, although some things like
Code: [Select]
#define TRYF(x) { int aaa_; if((aaa_ = (x))) return aaa_; }can already be called obfuscation :P
I removed a number of uses of that ugly, bug-inducing macro over time, but there remain many of them...

Quote
Does "ticalcs_calc_execute" still work for nspires? That would be perfect, escpecially if you can pass arguments!
For our purposes, ticalcs_calc_execute (calc_xx.c) calls into the ".execute" field of the calc_nsp structure defined in calc_nsp.c, which itself points to a function whose entire source code is
Code: [Select]
static int execute (CalcHandle* handle, VarEntry *ve, const char *args)
{
return 0;
}
So libticalcs doesn't support remote execution for the Nspire (while it does for most other models), but I don't know for sure whether the Nspire's OS itself does (the teacher software probably has features like that).

Quote
Oh, I don't think sending keys is a good solution.
For most models, it's the only solution - only the newest protocols (latter DBUS, DUSB) have a proper remote exec command, and maybe the Nspire doesn't :)

Quote
What if the user presses a key manually or disconnects the calc?
PEBKAC is not much of our concern ^^

Quote
Why separate conversion from file types?
For character conversion outside of files directly suitable for the calculator - for instance, in program editors. The author of the unfinished, long-unmaintained, buggy KTIGCC considers two-way translation between calculator charset and computer charset as a major feature of his program, but unsurprisingly, it has seen pretty little usage in the wild...

Quote
Why seperate libticables from libticalcs? Calcs without cables don't work :P
Sending files over the wire, and creating the bytes to be sent over the wire, are two strongly different concerns, even though the latter depends on the former.

Quote
The code base is too huge to be maintainable.
I don't think so, the TILP code base is far from being unmaintainable. It's in a reasonably usable state, and most of the code evolves pretty little, if at all. TIEmu is an unmaintainable code base, however, due to the fragile integration of outdated versions of a patched GDB, Tk, Insight, all of that mixed in the same event loop and sticked together by a fragile build system.
When I made the strip_tilp_nspire experiment, I didn't expect TI to come up with a new crappy, totally non-innovative TI-Z80 model, aimed at milking customers and expanding the lifespan of the TI-Z80 series by years...

Quote
A complete rewrite would take years, though.
A partial rewrite of <35K RLOC (some of the code could be copied with little in the way of changes) doesn't take years full-time, but it's still too lengthy a task for me to take on. There are other, more fun and more productive tasks to work on...

Quote
Browsers having USB support? Why not integrate firefox in the linux kernel and booting firefox directly? <_<
Well, people do lots of crazy stuff with browsers nowadays ;)
Even TI-Z80 and TI-68k emulators, and emulators for ARM cores as well.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 01:39:36 pm
Quote
Does "ticalcs_calc_execute" still work for nspires? That would be perfect, escpecially if you can pass arguments!
For our purposes, ticalcs_calc_execute (calc_xx.c) calls into the ".execute" field of the calc_nsp structure defined in calc_nsp.c, which itself points to a function whose entire source code is
Code: [Select]
static int execute (CalcHandle* handle, VarEntry *ve, const char *args)
{
return 0;
}
So libticalcs doesn't support remote execution for the Nspire (while it does for most other models), but I don't know for sure whether the Nspire's OS itself does (the teacher software probably has features like that).
I doubt it. What do you want to execute without ndless?
Quote
Quote
Oh, I don't think sending keys is a good solution.
For most models, it's the only solution - only the newest protocols (latter DBUS, DUSB) have a proper remote exec command, and maybe the Nspire doesn't :)
Or giving up this communication and letting the app store handle everything. A version on-calc would still be needed to install an app on a friend's calculator without any PC near.
Quote
Quote
What if the user presses a key manually or disconnects the calc?
PEBKAC is not much of our concern ^^
It is at least a bit. Imagine after the file transfer finished the user presses escape (to play the game) and the appstore displays an error message?
Quote
Quote
Why separate conversion from file types?
For character conversion outside of files directly suitable for the calculator - for instance, in program editors. The author of the unfinished, long-unmaintained, buggy KTIGCC considers two-way translation between calculator charset and computer charset as a major feature of his program, but unsurprisingly, it has seen pretty little usage in the wild...

Quote
Why seperate libticables from libticalcs? Calcs without cables don't work :P
Sending files over the wire, and creating the bytes to be sent over the wire, are two strongly different concerns, even though the latter depends on the former.
Why not both layers in one library?
Quote
Quote
The code base is too huge to be maintainable.
I don't think so, the TILP code base is far from being unmaintainable. It's in a reasonably usable state, and most of the code evolves pretty little, if at all. TIEmu is an unmaintainable code base, however, due to the fragile integration of outdated versions of a patched GDB, Tk, Insight, all of that mixed in the same event loop and sticked together by a fragile build system.
When I made the strip_tilp_nspire experiment, I didn't expect TI to come up with a new crappy, totally non-innovative TI-Z80 model, aimed at milking customers and expanding the lifespan of the TI-Z80 series by years...

Quote
A complete rewrite would take years, though.
A partial rewrite of <35K RLOC (some of the code could be copied with little in the way of changes) doesn't take years full-time, but it's still too lengthy a task for me to take on. There are other, more fun and more productive tasks to work on...
Especially this project here ;)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 09, 2013, 01:47:24 pm
Yes sure, but at least it will function directly and more quickly (no install time, I mean) for those on windows (and mac) with TINC[L]S installed, with no need of filter driver and such because of that crappy windows roadblock...
For Linux obviously libti* is the choice as it's easy to use there (and, well, is the only one).
Remember the main point here, whatever the choice : it has to be extremely simple for the user (no installation would be great)
I think the requirement to have tilp installed is as easy for the average windows user as having the TI software.

With the big advantage of not having a 42th abstraction over the real communication.
Tilp itself isn't the problem, in fact, it's the filter driver for windows.... :( The number of people willing to install new software (especially drivers, in fact, with some manual configuration...) for this would be very low...
The reason why I proposed nRemote is because it works "directly" as long as you have TINC[L]S (and well, it's Java, so at least it's mac+windows directly, too). But then, no Linux indeed. To be good, the backend thing about communication should be separate, so that on Mac and Windows, users could use the nRemote layer (well, the java thing, that is, not the whole nRemote obviously), and on Linux, Tilp.


Quote
And, also, let's not forget that if such App-Store project comes to life, it'll have to be for all .tns of course (there are tons of TI activities that could use this, but also Lua scripts, and duh, the ndless programs (especially those with external resources), so if it ever gets popular (who knows :P), the majority of users will be PC, then Mac, then Linux (and the order of file type will be TI BASIC things, then the Lua stuff, then the ndless stuff...)

For a real package manager (like pacspire  ;) ) every file is just a file, nothing special (except the metadata, of course).
Yep, good enough :)

Quote
Also, it'd be good to have such a program linked to the major community repos (ticalc, omni, tiplanet, cemetech...)
Oh, that wouldn't be a good idea. I prefer having a single repo. Fetching packages and metadata would get horribly slow and what is with different version (but same version number!) of the same app in two repos?
Quote
Yeah, a single repo is less of a maintenance problem.
That's perfectly true.... but what repo is going to be used ?
ticalc.org and tiplanet.org are the two websites with most nspire-related files (I dont know which has more, honestly, but I know tiplanet has a lot ...)
We (tiplanet) probably wouldn't have a problem making some php layer/web-service ( / API) to get the correct files in a wanted format over our archives system as it is right now, IDK about ticalc.org

Having a user-exposed file to edit repos and rules to get files from it (if not "standard" from the software POV, or something, IDK), would be cool.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 02:03:23 pm
Yes sure, but at least it will function directly and more quickly (no install time, I mean) for those on windows (and mac) with TINC[L]S installed, with no need of filter driver and such because of that crappy windows roadblock...
For Linux obviously libti* is the choice as it's easy to use there (and, well, is the only one).
Remember the main point here, whatever the choice : it has to be extremely simple for the user (no installation would be great)
I think the requirement to have tilp installed is as easy for the average windows user as having the TI software.

With the big advantage of not having a 42th abstraction over the real communication.
Tilp itself isn't the problem, in fact, it's the filter driver for windows.... :( The number of people willing to install new software (especially drivers, in fact, with some manual configuration...) for this would be very low...
The reason why I proposed nRemote is because it works "directly" as long as you have TINC[L]S (and well, it's Java, so at least it's mac+windows directly, too)
Yes, but Tilp uses libti*, which means it works if it's installed.
Quote
Quote
Also, it'd be good to have such a program linked to the major community repos (ticalc, omni, tiplanet, cemetech...)
Oh, that wouldn't be a good idea. I prefer having a single repo. Fetching packages and metadata would get horribly slow and what is with different version (but same version number!) of the same app in two repos?
Quote
Yeah, a single repo is less of a maintenance problem.
That's perfectly true.... but what repo is going to be used ?
ticalc.org and tiplanet.org are the two websites with most nspire-related files (I dont know which has more, honestly, but I know tiplanet has a lot ...)
We (tiplanet) probably wouldn't have a problem making some php layer/web-service ( / API) to get the correct files in a wanted format over our archives system as it is right now, IDK about ticalc.org
Importing them manually or automatic, and maybe displaying a message that new apps shouldn't be uploaded there.
But what if a developer disagrees (I doubt that)?
Quote
Quote
Having a user-exposed file to edit repos and rules to get files from it (if not "standard" from the software POV, or something, IDK), would be cool.
MySQL Database with all apps and AUTO_INCREMENTed ID + Subdirectories.
Communication over XML, e.g:
http://apps.tiplanet.org/list (a php file):
Code: [Select]
<XML STUFF>
<repository version="0.1" name="TI-Planet main repo">
<app name="Tile World" version="1.3.0" id="1" cx="true" classic="true">
<screenshot>1/screenshot.png</screenshot>
<description>First app available here</description>
<author>ajorians</author>
<package version="0.1">1/tworld.pcs.tns</package>
</app>
</repository>
On http://apps.tiplanet.org/index.php you would get a nice login and registration form (or the forum accounts)
and you can submit new apps and update your own. And most important: Download the App Store!
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 09, 2013, 02:50:34 pm
Quote
Quote
So libticalcs doesn't support remote execution for the Nspire (while it does for most other models), but I don't know for sure whether the Nspire's OS itself does (the teacher software probably has features like that).
I doubt it. What do you want to execute without ndless?
Forcing a whole classroom of calculators to open an activity when starting a lesson ?

Quote
Quote
Sending files over the wire, and creating the bytes to be sent over the wire, are two strongly different concerns, even though the latter depends on the former.
Why not both layers in one library?
I can only speculate about it, as the organization of the libraries was made before my time as the maintainer, but at least, having libticables separate from libticalcs makes it possible to depend on libticables without depending on libticalcs, if one wants to implement completely different protocols :)

Quote
Communication over XML, e.g:
JSON is more lightweight.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 03:42:15 pm
Maybe we should agree on some things now? ;D

My original idea was to install all packages into a central directory (e.g. /pacspire/) and to create a shortcut to the program in the documents folder (shouldn't be hard if ndless's ploader was exposed to pacspire).
Pacspire itself would get a simple GUI to list and remove packages.
Adriweb said pacspire should be able to install everything, including TI-BASIC and Lua stuff, but they 1. would have to be in the documents folder and 2. mostly are a single file (aren't they? I use TI-BASIC/Lua rarely), so I'm not sure how pacspire should keep track of that or if it is overkill to use a package manager for this (unless you are packing a bunch of scripts into a single package, or a lua script has dependencies like a luax extension, btw random thought: dynamic linking with ndless would be nice :P)

On the PC side, a small tool to generate packages and sending packages to the calc using nRemote/libti* would be nice.

So, what information has to be stored in a package?
Currently, there is a simple file called pkginfo.txt.tns with the following format:
name=Package name
version=Version string
timestamp=UNIX Timestamp (e.g. 1375988987)

and optional:
ext_name=txt
ext_prog=editor

The parser for this file is really crappy at the moment, it could be replaced by a real .ini-parser or something.

The next question is, should all packages be unzipped by default? Or should they be unzipped at runtime into a temporary folder? Or should pacspire pass an unzip-handle to the program so it can unzip its resources directly into RAM?
There could probably be an option for this in the pkginfo file.

Of course a central repository would be nice, but is it feasible and worth the effort?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 09, 2013, 03:52:22 pm
Oh, I forgot...

Quote from: Adriweb
The reason why I proposed nRemote is because it works "directly" as long as you have TINC[L]S (and well, it's Java, so at least it's mac+windows directly, too). But then, no Linux indeed. To be good, the backend thing about communication should be separate, so that on Mac and Windows, users could use the nRemote layer (well, the java thing, that is, not the whole nRemote obviously), and on Linux, Tilp.
It's not desirable for a portable community software to depend on TI's proprietary software. The fact that Ndless 1.0/1.1 do it is not a good reason for doing the same thing ;)
Licensing issues are probably not much of a concern here, as they should be mitigated by the usage of dynamic linking (upon both TI's software and libti*), but they should be checked nevertheless. At least, statically combining the GPL'ed libti* and TI's proprietary software is impossible.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 04:04:25 pm
My original idea was to install all packages into a central directory (e.g. /pacspire/) and to create a shortcut to the program in the documents folder (shouldn't be hard if ndless's ploader was exposed to pacspire).
Jup, I agree with that. It should be fairly easy to integrate that into ndless or even call the hook manually.
Quote
Pacspire itself would get a simple GUI to list and remove packages.
Adriweb said pacspire should be able to install everything, including TI-BASIC and Lua stuff, but they 1. would have to be in the documents folder and 2. mostly are a single file (aren't they? I use TI-BASIC/Lua rarely), so I'm not sure how pacspire should keep track of that or if it is overkill to use a package manager for this (unless you are packing a bunch of scripts into a single package, or a lua script has dependencies like a luax extension, btw random thought: dynamic linking with ndless would be nice :P)
Dynamic linking? That's even slower than loading elfs on the nspire. And you'll get many dependency problems and so on..
Quote
On the PC side, a small tool to generate packages and sending packages to the calc using nRemote/libti* would be nice.

So, what information has to be stored in a package?
Currently, there is a simple file called pkginfo.txt.tns with the following format:
name=Package name
version=Version string
timestamp=UNIX Timestamp (e.g. 1375988987)

and optional:
ext_name=txt
ext_prog=editor

The parser for this file is really crappy at the moment, it could be replaced by a real .ini-parser or something.
If you want shortcuts in /documents/ you should add something like link_prog=tworld.tns and optionally autostart_prog=tworld.tns
Quote
The next question is, should all packages be unzipped by default? Or should they be unzipped at runtime into a temporary folder? Or should pacspire pass an unzip-handle to the program so it can unzip its resources directly into RAM?
That means modifying the programs and the programs wouldn't have full control over the files anymore (as they're only "virtual"). So I vote for the first option.
Quote
There could probably be an option for this in the pkginfo file.
Of course a central repository would be nice, but is it feasible and worth the effort?
I think so! At least I want to be reminded of a new ndless version if my nspire is plugged in. For apps it would be very practical.
It's annoying to find the correct thread, the newest post with attachment and then I have to download it into a temporary folder, start tilp, navigate to that folder, dragging the file and last, confirm overwriting.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: hoffa on August 09, 2013, 04:07:23 pm
Very good idea, I had never thought of a package manager before.

My attention span is too short to read the whole thread, but here are my two cents:

A package manager is a great idea, especially with projects that have tons of files. I find it crucial that such a program should focus on being:
- extremely simple to use: a whole bunch of settings and commands might be cool for some but it's a turn off for most
- extremely lightweight: it's still a calculator we're talking about, and as such I think a "TI-Nspire AppStore" is overkill and any computer-to-calculator package installing and such is way too hacky and too big of a maintenance mess, plus my user experience instinct tells me it's fun and technically nice but nobody is going to use it
I'm not using the word "extremely" lightly here, by the way.

The whole installing/uninstalling process should be well-defined and elegant. There should only be the bare minimum of metadata (name, version, maybe a short description). All installed files (except from the main executable) could also be placed in some hidden directory somehow (no .tns extension or something?) or everything could be nicely organized in a single main folder. Uninstall scripts (shouldn't be visible directly) could be just a text file with every line being a path to the file to delete. I have to stress on how important "elegant simplicity" is (and by simplicity I don't mean that it should be simple to install nTileWorld from your Android phone connected by serial cable to your fax machine using a single click, but it should be tiny yet in every single level simple while keeping in mind it's still a calculator) unless you (I'm not pointing anyone here) want to blow it and turn it into a dead toy for nerds. This is the kind of stuff that could play a central role with ndless and could be somewhat adopted by those using Nspires.

Quote
Of course a central repository would be nice, but is it feasible and worth the effort?
lolno
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 04:18:28 pm
Compare smartphones and handys. On a smartphone you get apps, on a handy you have to download .jars yourself.
But as the nspire isn't powerful enough to manage a centralized repo itself, we let the PC handle it.
If we have enough apps, a central source to get them would be very useful, how many are there approximately?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 04:26:16 pm
Well, I think we should start small (installing/removing/listing packages, autostart support, shortcuts, everything in a central folder outside of /documents/ hidden from the user -> no .tns extension needed) and then decice what to do next?

If we have enough apps, a central source to get them would be very useful, how many are there approximately?
More than 100 :P (many of them are outdated though)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: hoffa on August 09, 2013, 04:39:52 pm
Well, I think we should start small (installing/removing/listing packages, autostart support, shortcuts, everything in a central folder outside of /documents/ hidden from the user -> no .tns extension needed) and then decice what to do next?
This so much, I'd be happy to contribute.

Let's first make a simple, lightweight package manager for calculators. We'll take over the world later.

Oh and for the central repository I'm not entirely against it; I guess a website made exclusively for TI-Nspire PCS packages could (could) be pretty nice.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 09, 2013, 04:53:10 pm
Well, I think we should start small (installing/removing/listing packages, autostart support, shortcuts, everything in a central folder outside of /documents/ hidden from the user -> no .tns extension needed) and then decice what to do next?
This so much, I'd be happy to contribute.
Nice :)

Oh, and while we're at central repositories and stuff:
Spoiler For Spoiler:
(http://euve8284.vserver.de/~julian/trololo.png)
:P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 09, 2013, 07:53:14 pm
Nice to see that this app store idea is supported, this will help promoting community programs. I have actually been thinking of building one with the Chrome Web Store look and feel (there's strangely no open source clone of it at the moment that could be forked).

Sure. And by the way, would it be possible to make the program loader of ndless available to launched programs?

I have just added nl_exec() (http://hackspire.unsads.com/wiki/index.php/Ndless_features_and_limitations#Builtin_functions) to Ndless/Ndless SDK r877 (http://www.unsads.com/projects/nsptools/downloader/download/category/1). I haven't been able to test it extensively yet, tell me if everything works for you.
Implementing shortcuts should be straightforward, storing the target path in a plain text file with a .lnk extension should do.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 09, 2013, 08:07:33 pm
Sure. And by the way, would it be possible to make the program loader of ndless available to launched programs?

I have just added nl_exec() (http://hackspire.unsads.com/wiki/index.php/Ndless_features_and_limitations#Builtin_functions) to Ndless/Ndless SDK r877 (http://www.unsads.com/projects/nsptools/downloader/download/category/1). I haven't been able to test it extensively yet, tell me if everything works for you.
Implementing shortcuts should be straightforward, storing the target path in a plain text file with a .lnk extension should do.
A program associated to .lnk isn't needed?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 09, 2013, 08:09:46 pm
Yes, of course this is required :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 10, 2013, 02:51:51 am
Should I add my 2 cents ?

Only from what I can see in the topic (i.e. I never tested anything), something that bother me is the number of files/folders created.
Remember how slow the TI-Nspire is on generating the MyDocument view, and here with only one project it creates dozens of files.

Maybe pacspire should hide those files and offers a way to unhide them, such as Hide Manager (http://ourl.ca/14608) (by renaming the files/folders such that they do not appear in the MyDocument view).

On the other hand, as for the user-friendly part, as hoffa said, remember its only a calculator, and imagine yourself explain to this type of guy (http://ourl.ca/19371/357382;topicseen#new) (no offense here) how to use pacspire : I doubt it would be easy, but who knows if pacspire comes included with Ndless package ?

Also, I know nFrame (http://ourl.ca/15531/308243) is not yet ready, but would it help for the userfriendly part ?

Anyway, as for the others, I really like this project and would like to push it beyong its limits !
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: DJ Omnimaga on August 10, 2013, 04:03:57 am
Will hiding them fix the speed issue? I know that on the TI-84+, when programs are locked and not visible from the EDIT menu, there is a massive lag when moving the cursor from one program to another below 50+ locked programs. Of course, the Nspire is a different calc, but since TI still coded it, who knows? >.< I never ever tried any file management tool for the TI-Nspire.

Anyway I like the idea of a package manager for the Nspire! :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Hayleia on August 10, 2013, 04:20:42 am
Will hiding them fix the speed issue? I know that on the TI-84+, when programs are locked and not visible from the EDIT menu, there is a massive lag when moving the cursor from one program to another below 50+ locked programs. Of course, the Nspire is a different calc, but since TI still coded it, who knows? >.< I never ever tried any file management tool for the TI-Nspire.
Yes it works. Basically because "hiding" a program on a z80 calc was about hiding it from the users, not displaying them, but they still were in the "list of present programs". But on a Nspire, HideManager doesn't only hide the program from the user, it moves the program to a place that is not checked by the OS when displaying the My Documents" menu. So it is not only hidden, but also not parsed, which makes displaying faster.
(As an example, I moved all my GBA games with HideManager and I saved 9 seconds).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 10, 2013, 04:23:45 am
Will hiding them fix the speed issue?  [...] who knows? >.<
Experiments (http://tiplanet.org/forum/viewtopic.php?t=10191) have shown that hiding files solves the big delay encoured when accessing the My Document view, so we know.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 07:35:13 am
What if we simply store the programs below /documents? Only the links to them would be visible.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 07:49:21 am
I don't see why this wouldn't work :)

Also : should we create separate topics/shared-documents (google docs?) for the computer part and the calc part ?
It'd help being more organized and list ideas and such together.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 09:22:32 am
Another question: Do we want to support calculators without ndless installed (newer models, or if the owner isn't allowed to)?
Can libticables send files to hidden folders? I'd be great to have the appstore recognize packages installed with pacspire and vice versa.
Or handle jailbroken calculators differently than "genuine" ones?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 10, 2013, 09:39:05 am
Quote
Do we want to support calculators without ndless installed (newer models, or if the owner isn't allowed to)?
I'm not sure how could we support calculators without Ndless installed, when neither BASIC, nor Lua, can read and write files ?
What's more, in general, on principle grounds, we don't need or want to support the views of the manufacturer and school system. Most programs which could be installed through a package managers are games, because it's easier to make games than integrate with the OS.

Quote
Can libticables send files to hidden folders?
Well, hidden folders are outside of the /documents hierarchy, correct ? libticalcs is not any more able to send files outside of this hierarchy than TINC(L)S is. It might be on OS 1.xx, which contain a directory traversal vulnerability used for dumping the Nspire's OS (there's a better way, not implemented by libticalcs), but not on the OS versions we care about...
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: DJ Omnimaga on August 10, 2013, 09:44:59 am
Will hiding them fix the speed issue?  [...] who knows? >.<
Experiments (http://tiplanet.org/forum/viewtopic.php?t=10191) have shown that hiding files solves the big delay encoured when accessing the My Document view, so we know.
Good :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 10:19:49 am
Quote
Do we want to support calculators without ndless installed (newer models, or if the owner isn't allowed to)?
I'm not sure how could we support calculators without Ndless installed, when neither BASIC, nor Lua, can read and write files ?
What's more, in general, on principle grounds, we don't need or want to support the views of the manufacturer and school system. Most programs which could be installed through a package managers are games, because it's easier to make games than integrate with the OS.

Reasoning like this, you're simply restraining the target of the whole project to a few dozens people... which is clearly not the goal here.
And we are talking of generalizing the whole thing so that it can be used for any document, we wouldn't even "need" to know what type it is (of course, it's preferrable to do so in order to let the user know the maximum amount of info/metadata, it's always better). On the computer side, that is. On the calc side, of course, a package manager for just a single file may be overkill, but .. so what ?

Oh, BTW, you're wrong when saying "neither BASIC, nor Lua, can read and write files" : there are (and not just a handful) Lua and Basic projects that come with multiple files that have to be put inside of MyLib, to function, so they are reading/writing to external things, just not very freely.

I think we should indeed handle both cases :
- if the calc is not ndlessed, warn the user that the files won't be transfered outside of /documents, and that, of course, only Basic + Lua based .tns will work, unless they install Ndless (give a link and/or automate the installation if the user accepts to install it).
- if ndlessed, then, files will be transfered within /documents temporarily and then handled by the calc program to be moved somewhere else with a directly-user-accessible link created.

Some parameters could also be the default location of the transferred files, default behaviour for creating links, etc.


Quote
I'd be great to have the appstore recognize packages installed with pacspire and vice versa.
Approchaing some sort of a "syncing" feature, then, at the same time :) With a list.txt.tns within /documents that would be retrieved and parsed to see what's installed, the version, etc.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 10, 2013, 10:28:31 am
Quote
you're simply restraining the target of the whole project to a few dozens people...
There are far more than "a few dozen persons" who can install Ndless...

Quote
- if the calc is not ndlessed, warn the user that the files won't be transfered outside of /documents, and that, of course, only Basic + Lua based .tns will work, unless they install Ndless (give a link and/or automate the installation if the user accepts to install it).
- if ndlessed, then, it will be transfered within /documents temporarily and then handled by the calc program to be moved somewhere else with a directly-user-accessible link created.
OK, so you're thinking about moving more functionality on the computer side than I was thinking. That could be an option.

We're still very heavily in the brainstorming / planning phase, we'll prioritize features and make a design later :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 10:34:34 am
Quote
There are far more than "a few dozen persons" who can install Ndless...
But many school require OS > 3.1. The nspire is not a "gaming" platform, it's a calculator.

Quote
OK, so you're thinking about moving more functionality on the computer side than I was thinking. That could be an option.
Is libti* able to send and receive files without *.tns? At least "/documents/packspire/packages.txt" or whatever the database will be called should be hidden.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 10:39:09 am
Quote
you're simply restraining the target of the whole project to a few dozens people...
There are far more than "a few dozen persons" who can install Ndless...
Of course, but not so many if you're combining the conditions : getting aware of the project && getting convinced it is a good idea && resticting (with no other motive than pissing the management off) to ndless files[/b].
I'm just trying to help growing the targeted people ("catchment area" / "zone de chalandise" :P)

Quote
- if the calc is not ndlessed, warn the user that the files won't be transfered outside of /documents, and that, of course, only Basic + Lua based .tns will work, unless they install Ndless (give a link and/or automate the installation if the user accepts to install it).
- if ndlessed, then, it will be transfered within /documents temporarily and then handled by the calc program to be moved somewhere else with a directly-user-accessible link created.
OK, so you're thinking about moving more functionality on the computer side than I was thinking. That could be an option.
Ah, yes, sorry for not being clearer.

We're still very heavily in the brainstorming / planning phase, we'll prioritize features and make a design later :)
Sure, yes, options like that could be done later, it's not so important at first.


Also, I edited the previous post adding this, as it can be helpful for people not knowing this, and, well, it's a usecase of such a project :
"Oh, BTW, you're wrong when saying "neither BASIC, nor Lua, can read and write files" : there are (and not just a handful) Lua and (more) Basic projects that come with multiple files (other .tns) that have to be put inside of MyLib, to function, so they are reading/writing to external things (just not very freely, sadly, that I perfectly agree...)"
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 10, 2013, 10:40:05 am
Quote
Is libti* able to send and receive files without *.tns?
Nope, not more than TINC(L)S.
libticalcs doesn't support /documents/themes.csv and files at the root of /documents, or nested folders - both of which are rarely used, judging by the fact that they're infrequent feature requests.

Quote
Oh, BTW, you're wrong when saying "neither BASIC, nor Lua, can read and write files" : there are (and not just a handful) Lua and Basic projects that come with multiple files that have to be put inside of MyLib, to function, so they are reading/writing to external things, just not very freely.
I guess I could have written a mention such as "for our purposes"... but for pretty much everyone, "reading and writing files" means reasonable access to the filesystem, rather than limited, platform-specific functionality. TI's peculiar understanding of "reading and writing files" is not what we need for the purposes of the program we're currently discussing.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 10:57:12 am
Right, but the thing is that we have to support these kinds of documents since it's exactly the purpose of pacspire : easier multi-file projects installation :)

But as said, before, whatever the type, lua, basic, or ndless, it should not have to matter to the program (both computer and calc side)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 10, 2013, 11:03:38 am
Quote
Right, but the thing is that we have to support these kinds of documents since it's exactly the purpose of pacspire : easier multi-file projects installation :)
I was mostly thinking about reading writing the aforementioned calculator-side list of packages / files / whatever, not for the documents themselves.
But that makes me think that if we want to be able to store, on the calculator side, packaging information on calculators without Ndless, then using MyLib is our only option.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 10, 2013, 11:05:35 am
First of all, thanks ExtendeD for adding nl_exec :)

As for the Ndless/no-ndless question, I'm not sure how you would manage packages on a non-ndlessed calc. It would definitely require a lot more work on the computer side, which is at least not what I originally planned.
I still think we should focus on Ndless first, because it makes the most sense in my opinion.

But as said, before, whatever the type, lua, basic, or ndless, it should not have to matter to the program (both computer and calc side)
I'm pretty sure it will matter, because Ndless programs will have to be installed differently from the basic/lua stuff (outside from /documents/, with shortcuts, file extensions, etc.)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 10, 2013, 11:10:34 am
But as said, before, whatever the type, lua, basic, or ndless, it should not have to matter to the program (both computer and calc side)
As said by other people earlier, there is no interest in making pacspire support Lua nor Basic program, since they are only one-file-made.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 11:21:03 am
But as said, before, whatever the type, lua, basic, or ndless, it should not have to matter to the program (both computer and calc side)
I'm pretty sure it will matter, because Ndless programs will have to be installed differently from the basic/lua stuff (outside from /documents/, with shortcuts, file extensions, etc.)

In my opinion, the transfer itself shouldn't have to be different : what should change, is the behaviour of the calc program upon receiving the files :
 - if the metadata says it's an ndless file or [whatever user option forcing the destination not to /documents], then move that wheever it's good.
 - if [there is no metadata file ?] or it's an official .tns (easy to detect), then, don't move it (expect if user option blablba), but watch out that if there are several files, then, look at the metadata to know which ones have to be put in MyLib.


But as said, before, whatever the type, lua, basic, or ndless, it should not have to matter to the program (both computer and calc side)
As said by other people earlier, there is no interest in making pacspire support Lua nor Basic program, since they are only one-file-made.
You don't seem to have read :
Quote
Oh, BTW, you're wrong when saying "neither BASIC, nor Lua, can read and write files" : there are (and not just a handful) Lua and Basic projects that come with multiple files that have to be put inside of MyLib, to function, so they are reading/writing to external things, just not very freely.
nor :
Quote
Of course, but not so many if you're combining the conditions : getting aware of the project && getting convinced it is a good idea && resticting (with no other motive than pissing the management off) to ndless files[/b].
I'm just trying to help growing the targeted people ("catchment area" / "zone de chalandise" Tongue)



But I have to say it's difficult to keep up for new posts in this topic while writing :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 10, 2013, 11:38:42 am
You don't seem to have read : [...] nor [...]
But I have to say it's difficult to keep up for new posts in this topic while writing :P
Yeah, I skipped an entire page ... damn me.
Then, yes, for MyLib Basic/Lua programs, there is an interest, but how many are they exept Make3D demo and FormulaPro ?


On another topic, talking about web hosting, what should differ from the existing if there is no PC-side client ?
I mean what will be the differences between TI-Planet hosting (https://tiplanet.org/index.php?mod=archives&ac=cat3) and the pretty concept posted earlier (http://ourl.ca/19357/357368) ?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 11:53:04 am
You don't seem to have read : [...] nor [...]
But I have to say it's difficult to keep up for new posts in this topic while writing :P
Yeah, I skipped an entire page ... damn me.
Then, yes, for MyLib Basic/Lua programs, there is an interest, but how many are they exept Make3D demo and FormulaPro ?

Some programs of critor, too :P
And some "big" basic (and rarer, Lua, like your Make3d, yes) projects by other community members or even TI sometimes.


On another topic, talking about web hosting, what should differ from the existing if there is no PC-side client ?
I mean what will be the differences between TI-Planet hosting (https://tiplanet.org/index.php?mod=archives&ac=cat3) and the pretty concept posted earlier (http://ourl.ca/19357/357368) ?
Hmm.. the computer side is to have a unified repo-browsing and transferring experience that also makes the whole package-with-metadata thing easier (not made by hand by the user).
Concerning TI-Planet, since we'd already talked about having some API to get archive-info and whatnot (-in JSON, I believe, but that's not much the point), this would be the chance to get it done for a good/well-defined purpose.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 12:37:28 pm
You don't seem to have read : [...] nor [...]
But I have to say it's difficult to keep up for new posts in this topic while writing :P
Yeah, I skipped an entire page ... damn me.
Then, yes, for MyLib Basic/Lua programs, there is an interest, but how many are they exept Make3D demo and FormulaPro ?

Some programs of critor, too :P
And some "big" basic (and rarer, Lua, like your Make3d, yes) projects by other community members or even TI sometimes.
It won't be too much work to get support for such apps in, too.
I mean, it's just two things (hiding, linking) that will not be done for non-native programs.
Quote
On another topic, talking about web hosting, what should differ from the existing if there is no PC-side client ?
I mean what will be the differences between TI-Planet hosting (https://tiplanet.org/index.php?mod=archives&ac=cat3) and the pretty concept posted earlier (http://ourl.ca/19357/357368) ?
Hmm.. the computer side is to have a unified repo-browsing and transferring experience that also makes the whole package-with-metadata thing easier (not made by hand by the user).
Concerning TI-Planet, since we'd already talked about having some API to get archive-info and whatnot (-in JSON, I believe, but that's not much the point), this would be the chance to get it done for a good/well-defined purpose.
And, the two things above are the exact same thing, just with a different layout. We would need a native client, which also handles transferring the files (libticalcs + Qt?).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 01:25:46 pm
Quote
On another topic, talking about web hosting, what should differ from the existing if there is no PC-side client ?
I mean what will be the differences between TI-Planet hosting (https://tiplanet.org/index.php?mod=archives&ac=cat3) and the pretty concept posted earlier (http://ourl.ca/19357/357368) ?
Hmm.. the computer side is to have a unified repo-browsing and transferring experience that also makes the whole package-with-metadata thing easier (not made by hand by the user).
Concerning TI-Planet, since we'd already talked about having some API to get archive-info and whatnot (-in JSON, I believe, but that's not much the point), this would be the chance to get it done for a good/well-defined purpose.
And, the two things above are the exact same thing, just with a different layout. We would need a native client, which also handles transferring the files (libticalcs + Qt?).

I'd very much like to insist that to get as many people attracted to this project as possible, something without any external install would be better, and thus it's why I'd be thinking of a Java program which :
- if running on Linux, uses libti*
- if Mac or Windows, detect if TINC[L]S is installed, then use navnet, otherwise fallback on libti* if installed.
On both cases, if no transfer "driver" is detected (unlikely...), well, tell the user to get either one. (But the rest of the program could still work)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 01:39:13 pm
Quote
On another topic, talking about web hosting, what should differ from the existing if there is no PC-side client ?
I mean what will be the differences between TI-Planet hosting (https://tiplanet.org/index.php?mod=archives&ac=cat3) and the pretty concept posted earlier (http://ourl.ca/19357/357368) ?
Hmm.. the computer side is to have a unified repo-browsing and transferring experience that also makes the whole package-with-metadata thing easier (not made by hand by the user).
Concerning TI-Planet, since we'd already talked about having some API to get archive-info and whatnot (-in JSON, I believe, but that's not much the point), this would be the chance to get it done for a good/well-defined purpose.
And, the two things above are the exact same thing, just with a different layout. We would need a native client, which also handles transferring the files (libticalcs + Qt?).

I'd very much like to insist that to get as many people attracted to this project as possible, something without any external install would be better, and thus it's why I'd be thinking of a Java program which :
- if running on Linux, uses libti*
- if Mac or Windows, detect if TINC[L]S is installed, then use navnet, otherwise fallback on libti* if installed.
On both cases, if no transfer "driver" is detected (unlikely...), well, tell the user to get either one. (But the rest of the program could still work)
Althogh Java is absolute crap to develop a graphical application in, it might be the best option.
Using JNI to interface Qt with NavNet might be too complex.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: TIfanx1999 on August 10, 2013, 01:41:12 pm
*Cough* Just thought I would mention that TILP would not be usable for me (and I'm sure) other windows users. I have never successfully gotten it to run properly on this PC (running windows 7). In fact, the last time I tried to install it (a few months ago) it rendered both TI connect and itself unusable. This was following the instructions to a T. :/
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: hoffa on August 10, 2013, 01:41:36 pm
Quote
On another topic, talking about web hosting, what should differ from the existing if there is no PC-side client ?
I mean what will be the differences between TI-Planet hosting (https://tiplanet.org/index.php?mod=archives&ac=cat3) and the pretty concept posted earlier (http://ourl.ca/19357/357368) ?
Hmm.. the computer side is to have a unified repo-browsing and transferring experience that also makes the whole package-with-metadata thing easier (not made by hand by the user).
Concerning TI-Planet, since we'd already talked about having some API to get archive-info and whatnot (-in JSON, I believe, but that's not much the point), this would be the chance to get it done for a good/well-defined purpose.
And, the two things above are the exact same thing, just with a different layout. We would need a native client, which also handles transferring the files (libticalcs + Qt?).

I'd very much like to insist that to get as many people attracted to this project as possible, something without any external install would be better, and thus it's why I'd be thinking of a Java program which :
- if running on Linux, uses libti*
- if Mac or Windows, detect if TINC[L]S is installed, then use navnet, otherwise fallback on libti* if installed.
On both cases, if no transfer "driver" is detected (unlikely...), well, tell the user to get either one. (But the rest of the program could still work)

Most people pretty much never hook up their calculator to their computer, it's hacky, requires to download tools and has minimal benefits (compared to the work required to implement it nicely).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 02:23:29 pm
Althogh Java is absolute crap to develop a graphical application in, it might be the best option.
Using JNI to interface Qt with NavNet might be too complex.
Yeah, I had Java that in mind because it's at the same time directly cross-platform (no need for external QT and such) and could be linked to both libti* (JNI I guess, loading .dlls or .so or .dylib) and navnet (itself is using JNI but that's the deep navnet part which we won't use, only the high-level stuff are necessary. You can pretty much see what here (https://github.com/adriweb/nRemote/blob/master/src/Remote.java#L169).)
But I indeed know it's not the preferred language for many of us here :D (I myself didn't write much Java except nRemote ^^)

*Cough* Just thought I would mention that TILP would not be usable for me (and I'm sure) other windows users. I have never successfully gotten it to run properly on this PC (running windows 7). In fact, the last time I tried to install it (a few months ago) it rendered both TI connect and itself unusable. This was following the instructions to a T. :/
Same here (the filter driver thing is what blocked me, all the rest was fine) :/ And of course, it went flawlessly on Ubuntu... Ah, Micro$oft....

Quote
Quote
And, the two things above are the exact same thing, just with a different layout. We would need a native client, which also handles transferring the files (libticalcs + Qt?).

I'd very much like to insist that to get as many people attracted to this project as possible, something without any external install would be better, and thus it's why I'd be thinking of a Java program which :
- if running on Linux, uses libti*
- if Mac or Windows, detect if TINC[L]S is installed, then use navnet, otherwise fallback on libti* if installed.
On both cases, if no transfer "driver" is detected (unlikely...), well, tell the user to get either one. (But the rest of the program could still work)

You really think that would make people want to use it? Most people pretty much never hook up their calculator to their computer, it's hacky, requires to download tools and has minimal benefits (compared to the work required to implement it nicely). [rant]Plus, who uses a joke like Java anyway?[/rant]

I used to send my buddies games just by cable during classes (oh boy the hours spent during mathematics class playing Pokemon), and that's up to where the majority of people bother to go just to put some stuff on a calculator (and with the package manager at the very most two files would be required to be sent, one if it was integrated into ndless)
I believe this is way more true for z80 platforms than Nspires (and 68k at a lesser extent, though). That's probably because students would get a z80 "by default" whereas a 68k or an Nspire would actually be a choice.

And that is a good point for making the software (especially the computer one, since the calc one, once installed, means the user trusts the whole thing anyway) as intuitive/portable/easy-to-use as possible. Which is again why feature detection on Mac/Windows is important : if the user has TINC[L]S installed, the program needs to install nothing : it justs sits there (no install needed to launch a .jar or an exe/app where it's embedded into), using what's already available and not installing complementary libs (which is, also, not possible all the time, especially for a driver, if the user is not an administrator).

PS : I was/am also the calc-guy in class :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 10, 2013, 02:51:43 pm
I have added shortcut support now. (in the gif pacspire is configured to install packages to /pacspire -> only the shortcut is visible to the user, packages installed to /pacspire can't be removed at the moment :P)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 02:53:58 pm
If some program relies on specific files and the program binary being in a specific location in /documents, is it possible to disable linking?
Is is possible to associate a file extension to a hidden program?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 10, 2013, 02:56:31 pm
If some program relies on specific files and the program binary being in a specific location in /documents, is it possible to disable linking?
This shouldn't be necessary, because every Ndless program can easily be adapted to use relative paths (with enable_relative_paths()).

Quote
Is is possible to associate a file extension to a hidden program?
Yup, as ndless's ploader scans the whole filesystem (except /phoenix) for executables AFAIK.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 03:05:50 pm
Could you add an option "savefile=" or something similiar where you can list a file as savefile in the package metadata?
On uninstallation, the user will (if the program has savefiles and they exist) be prompted whether they should be removed.
It's hard to remove files in /pacspire..
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 03:10:37 pm
I don't know if this has been said ealier or not, but this made me think about uninstallation :

Would it be possible to hook the deletion of the lnk file (if any) to trigger pacspire so that it can properly uninstall everything, as you say ?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 10, 2013, 03:20:03 pm
Could you add an option "savefile=" or something similiar where you can list a file as savefile in the package metadata?
On uninstallation, the user will (if the program has savefiles and they exist) be prompted whether they should be removed.
It's hard to remove files in /pacspire..
Sure, but maybe something like savefolder would be better? :P

Would it be possible to hook the deletion of the lnk file (if any) to trigger pacspire so that it can properly uninstall everything, as you say ?
Possible: Yes, but probably not for me. Maybe someone who is better at reverse engineering could do it ;)
I'll make a GUI where it will be possible to remove packages.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 10, 2013, 03:30:39 pm
Possible: Yes, but probably not for me. Maybe someone who is better at reverse engineering could do it ;)
I'll make a GUI where it will be possible to remove packages.
On TI-Nspire CX CAS, somewhere between 0x102167A8 and 0x102167F8 you have in [R4] (char **) a pointer to the char sequence containing the name of the currently confirmed deleted file.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 03:35:44 pm
Isn't it easier to simply hook the remove() function?
(Not the function itself, the location it's pointing to)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 10, 2013, 03:59:57 pm
Isn't it easier to simply hook the remove() function?
(Not the function itself, the location it's pointing to)
remove() is not even called because TI.
I guess it has something to do with the Ctrl+Z feature of undoing deleting files ?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 04:10:29 pm
You can undo deleting files? Reminds me of DOS "undelete".
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 10, 2013, 05:54:52 pm
Quote
you're simply restraining the target of the whole project to a few dozens people...
There are far more than "a few dozen persons" who can install Ndless...

As a side note, to get a rough idea of how may new users try Ndless: there are about 1400 visits of the Ndless user guide each month.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 10, 2013, 07:37:04 pm
Quote
you're simply restraining the target of the whole project to a few dozens people...
There are far more than "a few dozen persons" who can install Ndless...

As a side note, to get a rough idea of how may new users try Ndless: there are about 1400 visits of the Ndless user guide each month.

Well, of course a lot of people install ndless (even thought we don't really know the % compared to the number of Nspires in the world (this would be very cool to know even if it would probably be scarily low in absolute, partly because a lot of handhelds are owned by schools and not students....)

But as I was saying :
Quote
Of course, but not so many if you're combining the conditions : getting aware of the project && getting convinced it is a good idea && resticting (with no other motive than pissing the management off) to ndless files.
I'm just trying to help growing the targeted people ("catchment area" / "zone de chalandise" :P)


Oh and, on our (TI-Planet) part, Ndless 3.1, launched in late January 2012, reached 40k downloads a few days ago (or was it yesterday ?) and is the most downloaded file every week I believe (not counting exam stuff when it's exam time, though), and is the 1st overall (http://tiplanet.org/forum/archives_list.php) (again not counting the exam stuff). Approx 71 times / day , 2100 / month.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 10, 2013, 08:50:40 pm
Lionel, you said libti* couldn't handle files in nested directorys, but that is simply wrong, because it works just fine :P
The next thing I'm trying to do is making a simple JNI lib for libti* for java, just as proof-of-concept.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 11, 2013, 01:48:03 am
Quote
Lionel, you said libti* couldn't handle files in nested directorys, but that is simply wrong, because it works just fine :P
The test program enables doing more stuff, but dirlist of a hierarchy containing nested directories does not work as it should (although an old commit at least prevents it from crashing upon such directory hierarchives, which it used to do) ;)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 11, 2013, 06:58:13 am
Quote
The test program enables doing more stuff, but dirlist of a hierarchy containing nested directories does not work as it should (although an old commit at least prevents it from crashing upon such directory hierarchives, which it used to do)
Umm, it does work? File size and type are correct as well.
Code: [Select]
TRYF(cmd_s_dir_enum_init(handle, "ndless/games"));
TRYF(cmd_r_dir_enum_init(handle));
I overwrote folder_name with "ndless/games" in the library and tilp shows the files just fine :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 11, 2013, 07:13:33 am
While some pieces happen to work, as you've noticed, the Nspire dirlist code simply does not handle recursive enumeration of more than one level in the hierarchy.
To see what I mean: on the calculator side, create an a1 folder at the root of the documents folder, then an a2 folder inside a1, then an a3 folder inside a2; then, on the computer side, trigger a dirlist from the root of the hierarchy. a2 is not enumerated, and it has broken type itself.

Locally, I've had some working code for higher-recursivity Nspire dirlist for a long time (like, more than a year), but I never finished reworking and cleaning up the dirlist data structure (some Glib trees) -> UI data structure (some GTK+ trees) code in TILP, so as to add support for > 1 level of folders (Nspire OS 2.xx and 3.xx) without breaking 0-level (TI-Z80) and 1-level (TI-68k) support.

And the code base contains assumptions that there's a single / in a valid calculator-side path. Nested folders trip that assumption. At select places, invocations to strchr()-type functions would have to be replaced by strrchr()-type functions.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 11, 2013, 06:53:43 pm
Wouldn't have it made sense to split the nspire support into an entirely different lib?
It doesn't share ANY code (except unneeded, like FileContent, which is for file group support and VirtualPacket) and it is very unlikely
to be used by an application which supports both the nspire and the other TI calcs.
And it seems I accidentially circumvented the
Quote
assumptions that there's a single / in a valid calculator-side path
by not using a slash in front of the path :P
I know it's slowly getting off-topic, but it doesn't fit anywhere else and the previous posts are important for context.
If anyone wants to move it :D
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 12, 2013, 02:06:46 am
Quote
Wouldn't have it made sense to split the nspire support into an entirely different lib?
In 2007, Romain Liévin definitely thought about making a new, fresh library, instead of adding support for the Nspire to libti*.
On the one hand, it would have made some sense, given that support for the Nspire doesn't use a number of facilities of the framework that the TI-Z80 and TI-68k supports use.
On the other hand, it's a calculator with mostly the same operations as the others, there is definitely some code sharing, it has the same direct USB cable as the 84+(C)(SE) and 89T, so it could be made to fit within the rest of the framework, and have TILP not depend on two different, though very similar, libraries.

Quote
It doesn't share ANY code (except unneeded, like FileContent, which is for file group support and VirtualPacket)
While some of them are definitely unnecessary for the Nspire, don't be too quick to remove all layers of data structures and abstractions. Cable send/receive (libticables) <- raw packet (splitting/reassembling what goes over the wire, nsp_rpkt) <- virtual packet and session handling (nsp_vpkt) <- commands (nsp_cmd) <- calc functions (calc_nsp) <- high-level operations combining multiple functions (e.g. tilp_calcs.c) does make perfect sense, even in the context of a single calculator and protocol series.
Although it looked complicated to me as well in the beginning, and it isn't perfect (but who is ?), the fact that the making of the libti* framework has received some thought. For the narrower purposes of interacting with the Nspire, it's over-designed... but it's much better to somewhat over-design things, than to under-design them and have to significantly refactor them later :)
"Start from small stuff and try to scale up" was exactly the approach used by Microsoft in the MS-DOS, then "early" Windows area (all the way up to ME), instead of "descend from big stuff and scale down to smaller computers" like the *nix series does... The end result was not quite the same from a reliability point of view.
Quote
and it is very unlikely to be used by an application which supports both the nspire and the other TI calcs.
TILP is actually the main use case, the one the libs have always been primarily designed for ;)


In 2007, what Romain did was probably the best course of action at the time. People were only warming up to Qt 4 (from 2005), the first version which had a FLOSS code base for Windows, and porting from Glib/GTK+ to Qt 4+ would have been much more work than the libti*/TILP I -> II API rework. At least, he was able to complete the API rework in the time he could allocate to it, instead of having some unfinished transition, and we all have been able to build some stuff on top of the improved rewrite since then :)
Nowadays, in 2013, restarting from scratch to build a C++11/STL, framework-neutral code base, on top of which Qt applications can be built without a Glib dependency, is a good idea, and has been for a while...

I'm convinced that the making the skeleton of a brand-new C++ framework tailored to the Nspire (but by all means, keeping the good design bits of the old ones, and reusing lots of code because at the lower level, the dependency on Glib is mainly g_malloc/g_free, g_list and g_tree !) wouldn't even be highly time-consuming...
A week of full-time work would go some way towards the creation of such a framework. Witness BrandonW's single-purpose C# hack for receiving an OS from a Nspire, inspired from the code in libticalcs and libticables.
But who can spend a week or two of work, full-time, on such a task ? Not me (not alone), sorry - I have a full-time job, I need it for paying the bills, paid holidays are not to be spent working full-time, and it's the same thing for everybody else...
[EDIT1, less than 1h later: sure, if people paid for several hundreds of euros, then I could spend a week full-time on creating the skeleton of a fresh code base, and certainly filling in some bits. But facts show that this is simply not going to happen - ask ExtendeD, who received almost zero over the years for Ndless... ExtendeD didn't even get a CX until Jim Bauwens sent him one of his calculators... I'm just about as responsible about the lack of donations as anybody, though unlike most, I did work on Ndless and related programs, such as nspire_emu.]

[EDIT2, around 5 p.m. CEST:
At least, you have motivated me for working on the libti*/tilp code base, which I hadn't done for a little while ;)
I've just completed an examination of the commits which occurred in upstream TILP between 1.16 (the base for strip_tilp_nspire) and 1.17. A majority of them contains hunks relevant to strip_tilp_nspire...]

[EDIT3, around 7 p.m. CEST: I've started upgrading the strip_tilp_nspire code base from TILP II 1.16 to TILP II 1.17. I've ported nearly 40% of the relevant commits, among which is the Glade/gettext -> GTK+Builder/intltool conversion, whose porting was relatively painless after all :)
Most of the translations are missing (the strings from libti* were never imported in the first place...), but the code base otherwise continuously works for the purposes of interacting with a Nspire CX CAS.]

[EDIT4, around 8 p.m. CEST: pushed 3 commits squashing the relevant bits of 23 upstream commits to http://github.com/debrouxl/strip_tilp_nspire . That's a bit less than 50% of the upstream libti*/tilp commits (with Nspire-related bits or documentation bits) between 1.16 and 1.17.]
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 12, 2013, 07:00:22 pm
Quote
At least, you have motivated me for working on the libti*/tilp code base, which I hadn't done for a little while
Yay, I did it! But I don't want to be only complaining, I'll presumably look at C++, as it's easier for me to understand the code by rewriting/copying and finding out why it doesn't work anymore ;) But I don't want to promise anything, I'll have some work to do, so it might take a while.

For the app store/pacspire: I definitely think we need some way to install something on not jailbroken calcs.
The newer ones come shipped with boot2 > 3.1, which makes installing ndless without soldering skills and an rs232 converter impossible (yet).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 13, 2013, 04:22:08 am
Quote
But I don't want to be only complaining, I'll presumably look at C++, as it's easier for me to understand the code by rewriting/copying and finding out why it doesn't work anymore ;) But I don't want to promise anything, I'll have some work to do, so it might take a while.
During the next few days, I'll try to finish bringing the strip_tilp_nspire code base towards the code in TILP II 1.17 + associated libraries, as well as making strip_tilp_nspire somewhat less of a one-off hack.
For now, everything is fused into a single "tilpm" ("tilp merged") executable, which is no good - there should be a shared library ("libtinspire" ?) again, and a front-end ("tinlp" = "TI-Nspire Linking Program" ?).
I've chopped out the unused Intel hex handling code, but that's less than 400 lines (~1+%).

Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 07:15:14 am
Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...

Well, for non-jailbroken calcs, "installing" would mean to just transfer one or more files into a specific directory, most of the time it'd be /documents (and sometimes /mylib), and.. that's all, since there is no more handling on the calc side.
Looks pretty simple ? (Both with libti* and navnet)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 13, 2013, 07:16:41 am
Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...

Well, for non-jailbroken calcs, "installing" would mean to just transfer one or more files into a specific directory, most of the time it'd be /documents (and sometimes /mylib), and.. that's all, since there is no more handling on the calc side.
Looks pretty simple ? (Both with libti* and navnet)
And probably a database file for installed programs (updates, uninstall, etc).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 07:22:07 am
Quote
I definitely think we need some way to install something on not jailbroken calcs.
Functionality would be severely limited...

Well, for non-jailbroken calcs, "installing" would mean to just transfer one or more files into a specific directory, most of the time it'd be /documents (and sometimes /mylib), and.. that's all, since there is no more handling on the calc side.
Looks pretty simple ? (Both with libti* and navnet)
And probably a database file for installed programs (updates, uninstall, etc).
Oh yes, forgot that.
A simple .txt.tns should be enough I guess ?
Although for uninstalling ,the only difference with jailbroken calcs would be that the user will have to tell the computer software that he's deleted [this] file.

(On another subject, I've almost finished a 1st version of an API for TI-Planet archives. It's for now outputting in json, but tell me what you want and I'll add that (the things are in a php array, so, it's just a matter or choosing the format)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 13, 2013, 07:39:25 am
Unsync between the database and the listed could be avoided by not using a database. A well-defined file naming would do I suppose, computer side software can easily discover what's on the calculator with directory listing.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 13, 2013, 07:41:20 am
But then the software needs to now where the files in a package are and how they're called.
This for every package could be slow, depends on how many packages exist.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 07:43:00 am
Well, do we have an idea of how long it takes for navnet/libti to list the whole /documents folder (recursively....) ?
For a small amount of files, medium, and big ?

If it's fast enough, the idea would be good (but the user can't rename files)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 13, 2013, 07:44:20 am
Even with a database the user couldn't rename files, so that's no issue.
But what's with file versions?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 07:52:37 am
Yeah right... >.<

So, a proper filenaming convention like :

UserDefinedOrDefaultName{1,40}_vMajor[.Minor[.Build]]{1,8}_ArchiveID{1,5}.pcs.tns

So, for example :  FormulaPro_v1.4.1_6034.pcs.tns

(Although idk about the usefulness of a .pcs extension for the final .tns file. Well, maybe to speed up the process of knowing it's been installed through the app store, in case, it's very useful ^^)

?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 13, 2013, 07:56:53 am
And libs? I don't want a library called Chemistry_EN10_5.2.11_4471.pcs.tns!
For apps or game it would still be annoying.
A database file would be so much easier, just ignoring files which don't exist anymore?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 08:01:51 am
I'll have to say I guess it can become quite annoying in the long term to have all those largely-named files yeah :/

However, same question as a bit before (I'm calling Levak here :D), can we hook up the renaming process, to update the database accordingly, then ?
(edit : for the files that are not in MyLib, since their names has not to change
Edit2 : and yes, thanks to levak which raised the valid point of saying that without a database, in fact, you can't track them with the naming conventions the lib files since they're hardcoded names))
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 13, 2013, 08:05:22 am
You can't rename lib files, since they are used with hard-coded names in the program codes.
Also it is a bad-design to rely on user-side.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 11:09:21 am
Well, sure, but you can't prevent the user from renaming his files, so, the hooking solution on the rename/move function to update the DB seems to be the best compromise?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 13, 2013, 01:48:17 pm
Well, sure, but you can't prevent the user from renaming his files, so, the hooking solution on the rename/move function to update the DB seems to be the best compromise?
No, if the user renames the files in MyLib its his problem. Same for a user that roots himself and change the files.
Hooking the Operating System is more convenient to add features to the user, not forbid him from renaming/deleting his files.
Plus, there is no advantage to hook the rename/move functions in order to update the DB. What would it do if its a lib ? There is no use.
Only a hook on the remove function could help the user to purge the hidden files.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 02:03:14 pm
You're talking non-sense.

The user has the possibility to rename.
So, eventually he'll do that. (worst-case scenario / murphy's law). It's his problem indeed if he renames a MyLib file, but this has strictly nothing to do with having a package manager.

Why would you not want to then update the obsolete DB ? I don't see any good reason to not hook the rename function to update the db if there is no technical difficulty in doing so.
It's just one of the advantage of having an ndlessed calc.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 13, 2013, 02:12:30 pm
Why would you not want to then update the obsolete DB ?
As ExtendeD said, I don't see any reason to maintain a database.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 13, 2013, 03:02:12 pm
Well, maybe there is another way than having a DB, but filenaming conventions will lead to annoyingly long names.
If there are other solutions, we still haven't found them, then.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 13, 2013, 03:11:34 pm
Well, maybe there is another way than having a DB, but filenaming conventions will lead to annoyingly long names.
If there are other solutions, we still haven't found them, then.
I still don't understand why you need to link the manager to the files. Only the reverse is needed, and, deleting the "link" file, with a hook, will uninstall the installed/hidden files. There is no use to make a reverse link and thus, no need to have a database/naming conventions.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 14, 2013, 11:38:11 am
All right, I've finished the first version of the TI-Planet API.

Documentation is here : http://tiplanet.org/forum/archives_voir.php?id=19600

TL;DR :
- search within the archives with filters
- get info about an archive by its id
- output possible in json, xml, php-serialized-array, php-print_r
- get/post requests supported
- http & https supported


tell me what else would be needed for the software

the current apikey (will change later...) for the appstore is ... the name of the package manager ndless program followed by the number 42.
Right now it's for debugging/coding purposes I guess, but for production, we'll get a new, "secret" api key (and this current one disabled)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 14, 2013, 01:30:20 pm
Quote
the current apikey (will change later...) for the appstore is ... the name of the package manager ndless program followed by the number 42.
Right now it's for debugging/coding purposes I guess, but for production, we'll get a new, "secret" api key (and this current one disabled)
Why not HTTP auth?

Could you change the author to be always an array? It's better to use foreach($authors as $author) than if(is_array($author))..
Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 14, 2013, 01:42:11 pm
Quote
the current apikey (will change later...) for the appstore is ... the name of the package manager ndless program followed by the number 42.
Right now it's for debugging/coding purposes I guess, but for production, we'll get a new, "secret" api key (and this current one disabled)
Why not HTTP auth?
I'll look into that. How is it different/better ?
But the good side of that is having the possiblity of getting results through an ajax call in JS, for example, while I'm not sure if it's possible with the http auth.
If I do get it to work, I'll try to support the 3 ways.

Could you change the author to be always an array? It's better to use foreach($authors as $author) than if(is_array($author))..
Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Why not. Then, same for the categories.

Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Yeah, for the App Store, I guess I'll have to support that, but this would have to be some kind of "unique" request (like, no more than once every x hours), since it's going to be huge....
I thought of having that supported with some "pages" system. Like, request from 0 to 1000, then 1001 to 2000, etc.

(For now, the max amount of results is 500, and I haven't implemented this "page" system nor the cooldown)

What do you think : page or cooldowned big request ?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 14, 2013, 01:43:29 pm
Nice start adriweb.
What is the API key for?
Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 14, 2013, 01:48:37 pm
Nice start adriweb.
Thanks :)

What is the API key for?
Basically to avoid misuse/abuse of the API by flooding our server from easily doable (big) requests ... :(
So, the simpler it is for the third-party user (app store developers etc.), the better it is.
Here, it's just another variable to pass, vogt suggested the HTTP auth, I'll take a look.

Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
Well, I suggested that the App Store could read several calc sites indeed, but the reply was that it would be quite difficult to handle multiple versions/duplicates, and such problems.
Ideally... with proper filtering, it could be great to have multiple sources...

But anyway, I can't make any APIs for websites I don't have the DB control ^^

I can also release the API source code, if that helps, only the queries will have to change, the rest is pretty generic.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 14, 2013, 01:55:11 pm
Quote
Yeah, for the App Store, I guess I'll have to support that, but this would have to be some kind of "unique" request (like, no more than once every x hours), since it's going to be huge....
I thought of having that supported with some "pages" system. Like, request from 0 to 1000, then 1001 to 2000, etc.

(For now, the max amount of results is 500, and I haven't implemented this "page" system nor the cooldown)

What do you think : page or cooldowned big request ?
We have some RPC going over a DSL 6000 connection (upload 300 kb/s) and the entire student-database(1800 students: class, name, groups, username, email, uid, birthdate..) can be fetched in under 2 seconds. Maybe gzencode (api.php?gz=1, 0 is default)?

Quote
Quote
Why not HTTP auth?
I'll look into that. How is it different/better ?
But the good side of that is having the possiblity of getting results through an ajax call in JS, for example, while I'm not sure if it's possible with the http auth.
If I do get it to work, I'll try to support the 3 ways.
No probs: http://api:[email protected]/api.php?gz=0

And disabling get helps against spamming the server logs and the client browsers history. Also, there's no request limit.

Quote
Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
For now, it doesn't matter how it's called. Some fields are missing a well-formed value (like nspire-os: major.minor) and some major features are missing (screenshot). Maybe even an installation count? Increment on installation and decrement on uninstallation?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 14, 2013, 01:55:15 pm
Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Yeah, for the App Store, I guess I'll have to support that, but this would have to be some kind of "unique" request (like, no more than once every x hours), since it's going to be huge....
I thought of having that supported with some "pages" system. Like, request from 0 to 1000, then 1001 to 2000, etc.

(For now, the max amount of results is 500, and I haven't implemented this "page" system nor the cooldown)

What do you think : page or cooldowned big request ?

Debian uses the compressed Packages.gz for this for instance. Or if you just fear for you database performance, make use of cache.

Basically to avoid misuse/abuse of the API by flooding our server from easily doable (big) requests ... :(
So, the simpler it is for the third-party user (app store developers etc.), the better it is.
Here, it's just another variable to pass, vogt suggested the HTTP auth, I'll take a look.

But how would the key be allocated? Would it be generated for each user?
Again making use of a cache or regularly generating static content makes this API key useless.

Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
Well, I suggested that the App Store could read several calc sites indeed, but the reply was that it would be quite difficult to handle multiple versions/duplicates, and such problems.
Ideally... with proper filtering, it could be great to have multiple sources...

But anyway, I can't make any APIs for websites I don't have the DB control ^^

I can also release the API source code, if that helps, only the queries will have to change, the rest is pretty generic.

I mean letting other sites implement the API (as Linux repositories or Eclipse update sites do). The API can be versionned, and a well-defined API doesn't depend on the underlying database structure.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 14, 2013, 05:56:11 pm
Hmm, sorry I don't have time to reply correctly to your messages (maybe tomorrow, but then, I'll be leaving for some days, so I'm not sure), in the meantime, you can find the source here :
https://github.com/TI-Planet/API

In a few words :
 - gz compression seems like a good idea
 - the TI-Planet archives don't feature a version field in the database (see what I did to hackily find the nspire_os already when there wasn't ...)
 - the key would only be for the app store software, so just one key, not for its users.
 - I'm not sure a cache would be such a great idea as the request can vary quite enormously, and the cache would get quite huge (?)
 - with the source now available, you're welcome to contribute :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 15, 2013, 03:31:42 am
- the key would only be for the app store software, so just one key, not for its users.

Then it's a public key, it can't protect you from anything.

Quote
- I'm not sure a cache would be such a great ID as the request can vary quite enormously, and the cache would get quite huge (?)

It would make sense for requests heavy for the database, search as full-text search (these one are actually not so random) or app listing (a few hundred kb, not so big but I/O intensive for a database).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 15, 2013, 05:46:59 am
- the key would only be for the app store software, so just one key, not for its users.

Then it's a public key, it can't protect you from anything.
Well, running a strings command on the executable would reveal it, probably (depending on how it's hardcoded, though), but 0.01% of the people would try that - and I'm not sure to see why they would do it if they can get their own by "asking".... It's certainly not the best protection but at least it's not nothing, and would stop 90% of novice "hackers"-wannabe. But anyway, without a secure connection, a wireshark sniffing could reveal the data sent... like any program using an api with a key, when not over an encrypted connection

Quote
- I'm not sure a cache would be such a great ID as the request can vary quite enormously, and the cache would get quite huge (?)

It would make sense for requests heavy for the database, search as full-text search (these one are actually not so random) or app listing (a few hundred kb, not so big but I/O intensive for a database).
Well, we'll have to see after some usages what the most often requested things are, and plan accordingly ?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 15, 2013, 06:37:51 am
(mods: feel free to merge if judging as double post, meh)

I have integrated the &gz=1 (default 0) flag, but I don't really know how to test - at least it gives me no error, either on the client side not the server side :

https://github.com/TI-Planet/API/commit/6dc9c20b761753d08104a9a14173fbbae9e22eaa


I'll be looking at http auth (but there may be some underlying issues with apache/lighttpd that I don't really control / know about
Lionel ?)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 15, 2013, 07:19:33 am
(mods: feel free to merge if judging as double post, meh)

I have integrated the &gz=1 (default 0) flag, but I don't really know how to test - at least it gives me no error, either on the client side not the server side :

https://github.com/TI-Planet/API/commit/6dc9c20b761753d08104a9a14173fbbae9e22eaa
Delete that useless header( stuff. It will only confuse file_get_contents on the other side, me, and my browser, which wants to download a file api-response-something.gz  Just output it directly. BTW: gzencode is PHP > 4.0.4, but gzdecode is PHP > 5.4 -.-

Quote
I'll be looking at http auth (but there may be some underlying issues with apache/lighttpd that I don't really control / know about
Lionel ?)
Just a .htaccess with auth user file and requre valid-user. In the PHP file you can get the user with $_SERVER[PHP_AUTH_USER].
Or make the authentication optional, then serching should only be allowed if the user is authenticated.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 15, 2013, 08:06:25 am
(mods: feel free to merge if judging as double post, meh)

I have integrated the &gz=1 (default 0) flag, but I don't really know how to test - at least it gives me no error, either on the client side not the server side :

https://github.com/TI-Planet/API/commit/6dc9c20b761753d08104a9a14173fbbae9e22eaa
Delete that useless header( stuff. It will only confuse file_get_contents on the other side, me, and my browser, which wants to download a file api-response-something.gz  Just output it directly. BTW: gzencode is PHP > 4.0.4, but gzdecode is PHP > 5.4 -.-

Quote
I'll be looking at http auth (but there may be some underlying issues with apache/lighttpd that I don't really control / know about
Lionel ?)
Just a .htaccess with auth user file and requre valid-user. In the PHP file you can get the user with $_SERVER[PHP_AUTH_USER].
Or make the authentication optional, then serching should only be allowed if the user is authenticated.

Ok, for the header; do I just leave one for the charset or something ?
And... what about encode/decode, do I need to do something else ?

And for the .htaccess that's exactly the problem, we don't use them our tiplanet as they don't work (don't ask me why) - last time we tried to understand, we couldn't see...
Maybe it's changed since some updates recently, but I doubt it, it's been like this for quite a while...

btw, for us lighttpd is for http and apache for https.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 15, 2013, 01:04:38 pm
Quote
Ok, for the header; do I just leave one for the charset or something ?
And... what about encode/decode, do I need to do something else?
For our RPC the output is simply the following:
Code: [Select]
echo gzencode(json_encode($result));Our RPC client uses:
Code: [Select]
$remote = @file_get_contents("http://" . self::$username . ":" . self::$password . "@" . self::$host . "(...)", false, $context);
        if($remote === FALSE) (...)
        $result = json_decode(gzdecode($remote), true);

Quote
And for the .htaccess that's exactly the problem, we don't use them our tiplanet as they don't work (don't ask me why) - last time we tried to understand, we couldn't see...
Grep the whole apache config directory for "AllowOverride", most likely that's your issue.

Quote
btw, for us lighttpd is for http and apache for https.
May I ask why?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 15, 2013, 01:28:48 pm
Quote
Quote
btw, for us lighttpd is for http and apache for https.
May I ask why?
Historical reasons :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 17, 2013, 06:48:20 pm
it's normal to show me this if I've ndless r825?
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 17, 2013, 06:48:46 pm
Yes, it's too old.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 17, 2013, 06:50:38 pm
Yes, it's too old.

the 825?:s as I know it's the newest...

EDIT: nevermind, I didn't saw the r848
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 17, 2013, 06:51:40 pm
No, 877. By request of compu a new feature got added which pacspire uses.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 17, 2013, 06:54:12 pm
No, 877. By request of compu a new feature got added which pacspire uses.
the 848 is the newest as I can see
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 17, 2013, 06:54:59 pm
http://www.unsads.com/projects/nsptools/downloader/download/release/1 (http://www.unsads.com/projects/nsptools/downloader/download/release/1)
The last one says 877.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 17, 2013, 06:56:46 pm
http://www.unsads.com/projects/nsptools/downloader/download/release/1 (http://www.unsads.com/projects/nsptools/downloader/download/release/1)
The last one says 877.

but if you see the first...says 848
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 17, 2013, 06:57:29 pm
But the last one is 877.
877 > 848!
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 17, 2013, 07:00:03 pm
But the last one is 877.
877 > 848!
:O I was thinking that i was writting/seeing 884 -.-
I think that I need a rest xD
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 17, 2013, 08:13:46 pm
As I'm working on USB calc-to-calc connectivity with Ndless, I'm actually hooking into NavNet, which is the TI-Nspire specific protocol and TI driver for standard OS services (dir listing, screenshots, file transfers, ...). The new syscalls can be used to call services and expose new ones.
This may be useful for the package manager if the calculator side wants to communicate specifically with the computer side.

http://www.mirari.fr/UcCi (http://www.mirari.fr/Qywb) (computer side on the left, calculator side on the right, this is a simple echo service).

Writing both the client and host programs requires less than 50 lines of code (Interestingly the host side can be ported to the TI-Nspire with few changes for calc to calc transfers, although this might not make sense for a package manager).
I'm not sure if NavNet requires the computer to initiate the service calls (all the standard services are computer to calc...).

(Lionel, I'm at the moment loading navnet.dll, but switching to libticalcs when running on Linux shouldn't be too difficult I suppose as long as we can match the 2 APIs).
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 17, 2013, 08:24:47 pm
This is just... perfect!
With this we can make our own "exec" and even transfer files without tns or compressed or below /documents or debug easier!

Quote
As I'm working on USB calc-to-calc connectivity with Ndless, I'm actually hooking into NavNet, which is the TI-Nspire specific protocol and TI driver for standard OS services (dir listing, screenshots, file transfers, ...). The new syscalls can be used to call services and expose new ones.
How did you find it out? I mean, the OS is big and the USB protocol and such things are quite complicated in software.
Searching for function addresses and finding out which parameter is what surely took long.

Quote
(Lionel, I'm at the moment loading navnet.dll, but switching to libticalcs when running on Linux shouldn't be too difficult I suppose as long as we can match the 2 APIs).
Oh, the API for TI-8* and nspires is the exact same, so I fear it's not possible without more functions exposed..
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 17, 2013, 09:21:23 pm
Indeed, congratulations, looks very nice :)  (and quite simple !)

Although that would mean for ndless-calcs only (at least for non-standard stuff I suppose?), the main purposes would be to enhance the features by sending commands to the nspire to, like, automatically move files, for example, once transferred, right ?
Or do you have other usecases in mind ? (I guess you opened a door for imagination ^^)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 18, 2013, 02:51:13 am
Quote
I'm not sure if NavNet requires the computer to initiate the service calls (all the standard services are computer to calc...).
TINC(L)S, and therefore libticalcs, does it, so I'd say "probably" :)

Quote
(Lionel, I'm at the moment loading navnet.dll, but switching to libticalcs when running on Linux shouldn't be too difficult I suppose as long as we can match the 2 APIs).
It's alright to use, in the beginning, an API that you already know because you already used it in the fairly distant past for Ndless.
At the time, libticables' special version of the libusb DLLs, required for working around bugginess in the Nspire's linking code, did not have either signature or filter driver support. Romain tried to mainline the changes a long time ago, he didn't receive a reply; I retried, and this time, I got a reply, made a patch, which got improved and integrated into the official version with filter driver support and signature.
Now that the main reason for not working with libti* has disappeared (although the belief that TI's software and libti*/TILP are mutually exclusive is so entrenched that more than two years later, some people still don't know about it), libti* support should be added quickly enough, so that community software such as pacspire doesn't depend (only) on TI's proprietary code ;)

Quote
Oh, the API for TI-8* and nspires is the exact same, so I fear it's not possible without more functions exposed..
Wrong. Remember from above, all implemented Nspire functions are exposed by libticalcs nowadays ;)
Functions which do not fit into the common API are actually, and currently, a thing of the TI-83+ family, far more than a thing of the Nspire family. There's a single Nspire operation which does not fit into the common API: Nspire keypresses, which do not fit in 16 bits, unlike TI-Z80 and TI-68k keypresses. However, the TI-83+ family has a dozen functions which do not exist on other models. A little while ago, I made a low-usefulness patch for adding a number of such functions; it's queued in a local branch, but I have not committed it to master yet because, precisely, the usefulness is low.
If support for quizzes, and various other functionality rarely used outside of special equipment in classrooms, baked into TI's higher-level libraries which use NavNet.dll, were to be added to libticalcs, then the number of functions which do not fit into the common API would rise.


EDIT: looking at the code:
* the group of initialization functions, from TI_NN_Init() to TI_NN_DestroyOperationHandle(), can be replaced by libticables / libticalcs equivalents, see the authoritative test_ticalcs_2 example in the libticalcs source.
* TI_NN_Connect() <-> nsp_session_open() defined in nsp_vpkt.h;
* in this situation, TI_NN_Write() is the exact equivalent (with a different SID) of nsp_cmd_s_echo() defined in nsp_cmd.h, which calls nsp_vtl_pkt_new_ex() + nsp_send_data() + nsp_vtl_pkt_del(), all from nsp_vpkt.h;
* likewise, TI_NN_Read is nsp_cmd_r_echo(), i.e. nsp_vtl_pkt_new() + nsp_recv_data() + nsp_vtl_pkt_del();
* TI_NN_Disconnect() <-> nsp_session_close() defined in nsp_vpkt.h;
The nsp_cmd_s/r_echo() pair is used by is_ready() in calc_nsp.c, used as a function pointer by the common ticalcs_calc_isready() API.

I guess I could add a pair of helper functions to nsp_cmd.c/.h:
* a near-copy of nsp_cmd_s_echo(), taking the last argument of nsp_vtl_pkt_new_ex() as parameter;
* a near-copy of nsp_cmd_r_echo(), taking the argument of ticalcs_info() as parameter.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 18, 2013, 03:40:22 am
How did you find it out? I mean, the OS is big and the USB protocol and such things are quite complicated in software.
Searching for function addresses and finding out which parameter is what surely took long.

I have been working with the Java bindings of NavNet for Ndless 1.1 and documenting the protocol (http://hackspire.unsads.com/wiki/index.php/USB_Protocol) a few years ago so I know the main concepts quite well. And logging is extensively available both on the computer and calculator side (NavNet is crossed-compiled).

I am giving up researches on the low level USB device API as it appears to be a proprietary Jungo API. Finding the FreeBSD host USBDI API was easier with the FreeBSD source code available.

Although that would mean for ndless-calcs only (at least for non-standard stuff I suppose?), the main purposes would be to enhance the features by sending commands to the nspire to, like, automatically move files, for example, once transferred, right ?

Yes, maybe its use should be limited to special operations indeed.

Quote
Or do you have other usecases in mind ? (I guess you opened a door for imagination ^^)

I'm a also working on this to provide an API for calc to calc transfers for Ndless programs.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Legimet on August 18, 2013, 06:47:59 am
This looks interesting. I'll see if I can add some features (once I install the latest Ndless SDK)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 18, 2013, 09:56:55 am
I have been able to confirm that the computer side can also expose NavNet services, and the calculator side can initate requests. NavNet does offer  2 way USB communication with a common API for calc-to-calc and calc/computer transfers.

Here's a a simple Google search demo which doesn't require much code to work (switch to HD if the video is too blurred):



I'll soon commit this to Ndless and share the demos to make it possible to bind pacspire with the Adriweb's API.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ElementCoder on August 18, 2013, 10:07:48 am
This project is going like a rocket it seems o.o You guys are doing an awesome job, just wanted to say that; keep it up ;D
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Jim Bauwens on August 18, 2013, 10:47:47 am
Very nice work ExtendeD! I'm looking forward to seeing the stuff in the Ndless API :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 18, 2013, 11:31:01 am
Indeed, pretty nice demo :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 18, 2013, 11:48:39 am
nice work extended :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Legimet on August 22, 2013, 01:21:56 pm
I just checked the svn, and the TI_NN* syscalls were added in r878. :)
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: compu on August 22, 2013, 01:53:09 pm
Nice!
I'm going to the Gamescom this weekend, so I won't be able to try them out before next week :P
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 22, 2013, 04:44:36 pm
I have only commited the addresses, I'm currently working on the functions definitions and tests.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 30, 2013, 10:35:35 am
Ok, I'm back to France, here are some changes :

- Removed the limit in number of results (it was 500 before)
- You can now list all files for a given platform, as requested :   ...&req=search&platform=68k   for example.
- Changed all occurences of "title" by "name" which makes more sense, I believe.
- Rewrote the wtf-esque multiple-fields-to-array things, which simplified other things.
- "Author", "Category", and "Platform" fields are now always arrays of string(s)

HTTP Auth is still in the todo list but it quite heavily depends on getting apache to run correctly, which is not a quickfix... For now, no changes to the the method of getting results : http get/post with the api key parameter.


Commit : https://github.com/TI-Planet/API/commit/3a33e075ec6e8a259dbf4cc14875891ca2dd3dc2
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: ExtendeD on August 31, 2013, 03:57:49 am
Good adriweb :)

And a subset of the NavNet API is now available in Ndless and the Ndless SDK r893 (http://www.unsads.com/projects/nsptools/downloader)!
Documentation (http://hackspire.unsads.com/wiki/index.php/Syscalls#NavNet) is available on hackspire, and samples in Ndless and Ndless SDK.

We now have all we need to make pacspire access the TI-Planet API :)
The packet manager UI could be either implemented on the calculator side or the computer.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Lionel Debroux on August 31, 2013, 03:59:54 am
On my side, I have queued a patch for adding generic send & receive commands to libticalcs, so as to provide an API close to TI_NN_Write and TI_NN_Read, but I haven't published it yet.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Levak on August 31, 2013, 05:58:39 am
Good adriweb :)

And a subset of the NavNet API is now available in Ndless and the Ndless SDK r893 (http://www.unsads.com/projects/nsptools/downloader)!
Documentation (http://hackspire.unsads.com/wiki/index.php/Syscalls#NavNet) is available on hackspire, and samples in Ndless and Ndless SDK.

I don't know if its the right place to talk of this, but you cut the "TI-Nspire specific" part in two with Navnet using a h3 instead of h4.
Now the Graphic API appears part of Navnet :D
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Adriweb on August 31, 2013, 06:00:35 am
Good job you two :)

Also, Extended, why not both ?
(well, eventually).

And this made me think that some files (and not just a few) are not .tns directly, but are zipped (or rar[er] - pun intended, whoooo - anyway, rar would be a pain on-calc, zip, probably less.)
So, should I add another "type" field to the api response, or will that just be left to the client to parse from the file url ? (it would be just one line in php, probably same or a bit more in C...)


Edit : Levak / ExtendeD : I reordered the doc (see Levak's post ^ )
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: AlexisVieira on August 31, 2013, 11:48:16 am
good job guys
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Legimet on August 31, 2013, 11:55:47 am
The only FOSS software for extracting rar that supports rarv3 is the Unarchiver (http://code.google.com/p/theunarchiver/downloads/list).

EDIT: It's written in Objective C, though, so I don't know how easy it would be to port it to the Nspire.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 31, 2013, 11:58:12 am
unrar? That's the official open source implementation if I'm not wrong. But it consists of some many cpp files that it seems to be huge and slow..
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Legimet on August 31, 2013, 12:09:25 pm
No, not unar, not unrar.
The FOSS version of unrar supports only rarv2, but unar supports a variety of archive formats, including rarv3 (https://www.fsf.org/blogs/licensing/free-rarv3-extraction).

BTW, the official version of unrar is proprietary.
Title: Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
Post by: Vogtinator on August 31, 2013, 12:47:58 pm
No, I meant GNA unrar. Ok, then the site was unbelievably old to state that it supports the most recent RAR format..