9

I have 1 GB of data that I would like to add to a CDF file, but I would like to avoid it being loaded into memory when someone opens the file (Free Player).

One gigabyte of info takes a lot of computer memory, and the user of the file doesn't need to have it all in memory (specially when the way Mathematica or Player manages the opening of the file originates, for a couple of seconds, a double memory consumption which will go above a 32 bit process limit).

So, this would work as something like a DB included in the CDF file. A dynamic structure interface will then allow the user of the CDF file to load only a part of the data into memory (Set a variable to a part of the total data).

P. Fonseca
  • 6,665
  • 2
  • 28
  • 60
  • 3
    Honestly, I don't think it's possible. I think that the frontend is smart enough to not load a verly large notebook completely under certain circumstances but I doubt you can control that. Have you tried to put that data into TagginRules, maybe in chunks and compressed and checked whether the frontend loads everything? Interesting question, I'm looking forward for more constructive answers... – Albert Retey Jun 01 '13 at 09:37
  • I agree with Albert. Due to the restrictions on data import posed on CDFs I don't think it's possible to load data after the CDF has been started. The only possibility that I see is to let the user use radio button panels to toggle-in the data, just like the computers of the 50s era. I guess you won't like to do that for 1 GB of data. – Sjoerd C. de Vries Jun 01 '13 at 11:07
  • @SjoerdC.deVries you mean having it in a non shown dynamic structure? But how to put it there in the first place? Frontend would freeze if I placed the data in the middle of the program... – P. Fonseca Jun 01 '13 at 12:41
  • I was talking about something like this, but not seriously. – Sjoerd C. de Vries Jun 01 '13 at 16:06
  • 2
    Import["http:"<>"//my.datar... positiry.org/data.mx"] should work also in FreeCDF – Rolf Mertig Jun 01 '13 at 23:16
  • @RolfMertig "Data import and export are not supported from within CDF Player with the exception of Wolfram-curated data sources (ChemicalData, CountryData, WordData, etc.)." (ref). – Sjoerd C. de Vries Jun 02 '13 at 00:01
  • @Sjoerd Did you try it? Last time I tried it just worked. Still, sure, it is not supported in the sense that it may be gone in the future. But that's fine. We should just all use unsupported stuff and then cry hard when it does not work any more and The W's will have mercy with us. – Rolf Mertig Jun 02 '13 at 00:07
  • @RolfMertig No I didn't. If this really works, I assume it is unintended as one may use it to execute Mathematica programs without owning the product. – Sjoerd C. de Vries Jun 02 '13 at 00:12
  • @SjoerdC.deVries It still works. Just put it into Initialization e.g. However, that does not really answer the question and I have no time to work something out. Feel free to do so. Regaring execution of (Kernel) Mathematica programs remember also this – Rolf Mertig Jun 02 '13 at 17:02

0 Answers0