iOS - Download json swift [closed] - json

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 5 years ago.
Improve this question
Good day.
I was faced with the task, can not find the answers on the internet, can anyone be able to help.
I need to send a request to the service. This request must be sent no more than 1 second once per hour. From the answer to the query to extract part of the data. When you receive or availability of this information, it should be added to the text box. Data should be stored and re-used after restarting the application.
To connect to the service, I use Alamofire. Help please, whether there is in this library any function to set the time limit, I request? And how to save the data? Save the new json file locally, or the data stored in an array, or use the database?
Thank you for your help.

I don't have an idea of setting a time limit, but you can explore the NSTimer function to check for that and if it is just a string that you want to store, you only need to use NSUserDefaults for that. It stores your data as a property list and you can access it from anywhere in the app at anytime.
Here's a link to help you setup NSUserDefaults.

Related

How to make sure to get data from api in swift [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 months ago.
Improve this question
I try to fetch some data from api and store the data in a userdefault, then in another func to use the value in the userdefault. But sometimes when I try to get the value in the userdefault, it has not been fetched from api because of the poor internet, so how can I make sure I can get the data before I execute the second func.
Or do you have any solutions?
Thank you guys
There can always be conditions where you can fail a fetch. When you are executing your function that uses the data you were fetching you can first make sure there is any data at all, before manipulating it.
For slow internet specifically, you can check "retries" and retry mechanisms: example
One more thing, UserDefaults shouldn't be used for storing large data, it's typically used for storing some user preferences like colors, fonts, etc. (It's not encrypted - unsafe)

Web scraping with Laravel [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 1 year ago.
Improve this question
Welcome, all
I would like to create a small web application, which needs to scrape data from another website and save the results to a database.
So, currently, I have Laravel 8 installed on my local windows machine, and I made a connection to the database, where I have "items" in the table that I need to save the data in
And the data may be changed from another website so I need this change in the database as well,
and need to scrape many items from another website so I need to know id or something else to distinguish one item from another
Now, the question is, what is the best way to do this? I've tried some tutorials but I haven't.
You can use a package Goutte or domcrawler, first you need to do a request of a url for that you can use GuzzleHttp or get the portion of html content and filter it and then save all this data on a table of your database.
You can read more information about those libraries.
Another library that is more customizable is domcrawler Dom_Crawler,
Goutte

Should I use a website form or a diy form program as MySQL front-end? [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 4 years ago.
Improve this question
I have a MySQL db that is supposed to store shift details like start time, employee, breaks, nr. of items processed etc. to then analyze this data with MS PowerBI.
The employees are supposed to enter the data themselves after their shift and be separated from the data (not see or change it afterwards).
How should I set up the form the employees enter their data into? Should I make a website with a form on it or should I make a diy program that connects to the db?
I am quite new to all of this so I’m trying to find the best way to complete this.
Thank you very much in advance!
You already have a best guess. Yes, create a website which allows the employee to enter the details, grab the info with a back end application (php/java/kotlin/nodejs/python ... e.t.c), and do not develop a page that retrieve data to the website for the employees.
Afterwards, you can export your data to your desired application (you might need to develop something for smooth data transfer as well)

creating open source online game [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 7 years ago.
Improve this question
I started creating online open source game as a project in school. It will be server with n connected clients. But now I have a problem with "security". What to do if one client would used modified source code for changing some restrictions? How can I prevent it? My first idea was make client only for connection to server and server would send all necessary files but I don't like this idea very much. Can you advise me something better? Thank you.
You need to keep your validations in the server. The server should check each client move, and if it's not allowed according to the server's rules - reject it.
You should still keep validations in the client, too, so that users who don't mess with the client code can get speedier responses.

Best way of storing data in google app script [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 6 years ago.
Improve this question
I just started developing a Google web app, may I know what is the best way of storing data? Is it by using scriptDB, spreadsheets or JDBC?
You can take the hard work out of working with data storage by using this library:
http://www.harryonline.net/scripts/objdb-storing-data-with-google-apps-script/482
Using this library, you can work both with spreadsheets and JDBC databases, and easily switch if you later change your mind.
If you want to modify the data directly, then you can save data in spreadsheet and build apps based on spreadsheet data. If you store data in ScriptDB, you can not edit data easily. It all depends on your requirements.