Where should I store a small amount of data for my application? [closed] - storage

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am going to make a program for learning languages and I want to add words to the dictionary so I can check them whenever I want to. I am going to store the word, its translation, definition and example(s) of use.
I can use databases but I am afraid it is too much because once i finish this little project I want to convert it to .exe file (I am using python) and send it to my friends and I don't want them to download SQL DBMS.
I have seen some ideas like - store it in .csv or .xml or even .txt files but I am not sure if it's the best option.

I believe the most appropriate way of storing a dictionary is by using a .json file. IIRC the python package json makes importing and exporting easier.

You can use SQLite as database.
It does not require to install a DBMS and once you create the .exe all the modules from python to use it are included

Related

I made a game with Ruby, How do I make it playable on the internet?[Ruby] [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
It is a very simple game, only consisting of about 80 lines of code, and 2 images. I am a new developer, so pardon my ignorance.
I uploaded the three files to a domain, but when I visit the location, it just downloads the file.
What do I need to do in order to have the file be executed opposed to just downloaded? What other information is relevant to running it as a 'web app'?
Thanks
If you're written a console application (which it sounds like you have) then you will not be able to run it on the web. Depending on what you've made you may be able to translate it into a web application using a Ruby web framework like Ruby on Rails or Sinatra. If you link to your GitHub or wherever the code is you may be able to get more specific advice.

Data model in Swift [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm learning Swift and I have a question about data model or the Model folder in Xcode. During a project 'Quiz app' we opened a new swift file in Model folder and started to write some code in it.
What is Data model and why instead of writing all the code just in the ViewController file we need to write a separate one in the model folder?
You could, technically, have all the code for your app in a single file. But it would quickly become really hard to find somethig and keep it readable. Also, when working in bigger teams, having a lot of code in few files results in merge conflicts, which could quickly get out of hand.
It is simply a good practice to keep all your classess in separate files, grouped in folders.
As for what a „data model” is - it’s just a representation of your domain problem in code. These classess will most likely represent data you retrieve from web, or create in app to perform some further operations on them or to use them as input for views to present them to the user.

Parse replaces Core Data? iOS [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am developing an app where I am going to use NSUserDefaults to store some profile variables (name, picture, etc), I think.
I think I need to store some long huge lists of values for each user and I read about Parse and Core Data. What is the best? Can Parse replace Core Data?
What is useful on this case? Both?
Thanks in advance
Parse will store your data on their infrastructure on the cloud. You can enable Parse object caching to keep that data for offline use as well. For most apps I build, I avoid using CoreData (although Parse may be internally using some for of local store, could be CoreData) and use Parse explicitly with caching.

Best practices for updating local JSON data file in Swift app? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
My app will ship with a local JSON file for the data, so that everything functions properly offline (because the region the app is based on is hit or miss on connections). I would like to be able to update the local file from time to time with an updated version that is hosted on a server.
Should I download the updated file and overwrite the local file with it, or is there a way to check to see if the file has been updated before downloading?
Also, what event would be best to do these type of tasks on? Downloading the file and overwriting the local copy every time the app runs seems like overkill, but I don't really know how I would go about checking the server file to see if the file is newer before downloading.
I'm new to programming in general, so I don't really know the best practices way to handle something like this.
Any help is appreciated.
This is a general question and there's a lot of implementation details. Try to break things down into several more specific questions.
But a common pattern is to use versioning. That is, at the top of the file is a version attribute. Every time the server updates the file, it religiously increments the version. The client can do a tiny web-endpoint JSON query for just the version number and get back a single integer. It can read its own file on App startup, cache the local version number, and periodically compare.
How often to compare is completely App specific, but the version query will be lightweight and of constant size regardless of how big the file gets.

Creating a database in Xcode [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I want to create a searchable database in Xcode - for example, of different trees. The database would consist of the tree name, two images, price, and a short description. What is the best and most efficient way of creating such a database?
I am aware of: Core Data, SQLite3, and Parse. I am leaning towards SQLite3 but have not found a good place to learn how to implement this. Any suggestions?
Seeing as you are new to Objective-C and I doubt this will evolve into something need direct SQL I would suggest using CoreData. Although it is not technically a data base it is an object graph, it is built for exactly what you are wanting to do. Apple was even nice enough to build wrappers for everything you want to do.
CoreData to store your tree name, two images, price, and a short description.
NSFetchedResultsController for grabbing it.
UISearchBarController for letting the user search.
You would want to use Parse if you wanted to save your data to a server. If your doing everything locally I wouldn't worry about Parse. CoreData is what you want.

Resources