Jump to content
Sign in to follow this  

Random Problems Extraction

Recommended Posts



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, :)

Share this post

Link to post
Share on other sites

INI file, XML file, SQLite database file, etc., etc.

Lots of options for more efficient storage.


Edited 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

Share this post

Link to post
Share on other sites

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:


Active Directory (NEW 2018-12-03 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

ADO - Wiki


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this