eEniquEe Posted April 1, 2011 Share Posted April 1, 2011 Hi,I'm having a little bit troubles with my current project. Basically, it's a Mathematics Problem Generator. I have, like 1000 problems. Each problem can be stored in a text file, with less than 500 bytes long.The problem is that, I haven't found a way, to store those problems efficiently. What I mean is that it should take as little disc space as possible, and the reading speed should be acceptable, and when loading the problem, it shouldn't take much RAM.I'm thinking about storing each problem in each separated file naming from Problem 1.txt to Problem 1000.txt.But since each problem is less than 500 bytes. And any file which is less than 4kB, when stored in my computer, will take up to 4kB disc space. So even a 500 bytes file will takes up 4kB space on the disc. That's 8 times bigger than the actual size. So, I'm also thinking about grouping 8 problems into 1 single file. But when generating the problem, the program will have to read the whole file (this is RAM con-summing), and take one arbitrary problem from that set of 8 problem (reading speed).I hope I'm being clear enough.I wonder if there's some way that is more efficient than storing each problem in a single file like that? Can someone please give me a push?Thanks everyone very much,And have a good day, Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 1, 2011 Share Posted April 1, 2011 (edited) INI file, XML file, SQLite database file, etc., etc. Lots of options for more efficient storage. Edited April 1, 2011 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
water Posted April 1, 2011 Share Posted April 1, 2011 Why worry about disk space? 1000 x 4KB equals to about 4 megabytes. No big deal on todays computers. When space is an issue (USB device, transferring over slow connection ...) put everything into a single ZIP-file and unzip it on the target device. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now