All, I am a noob in Backbone, The question I asked maybe is easy for you .
Recently I began to learn it from some basic tutorials, I found many demos mentions the localstorage which I can't understand .
Say we have some code like this.
window.EmployeeList = Backbone.Collection.extend({
model : Employee,
localStorage: new Store("employees")
});
Can anyone help to tell me where is the data employee stored in ? What is the localStorage? thanks.
The localStorage is a small database built into the browser. Usually it is for small Data <5MB
You can think of it as a better form of a cookie. You can create stores like your "employees" store and save data to it like a normal database.
This should improve performance and capabilities of modern web applications. For example google mail uses this localstorage to keep a local copy of your inbox in case your client is offline (no network on mobile devices)
You can inspect the localstorage e.g. in google chrome by F12 -> Resources -> LocalStorage
Related
I have built an information based app with server side content that is displayed for the user to view but not edit or generate on their own. The information is examples of Species and the User is able to favourite a Species. Currently I have the Species hardcoded in a Dart db and is passed throughout the app when navigating or favouriting to that runtime instance.
I have set up users through firebase. I assume I will need to convert my Species db to JSON and store as a collection on Firebase in order for the user to favourite and instance of a species. My question is how do I upload or import my Dart database into Firebase? I know there's the JSON conversion but I assume we don't want to run that everytime the app loads.
Any help or guidance as I haven't found anything just yet, it may be my ignorance of nomenclature! I don't believe it is a real time database, but please correct me. Thanks.
Okay so I’m need guidance on where to start.
What I want to do is upon clicking a button in my web app which will be labelled “search” the web app will connect to my realism database and search the data base for the “search criteria” and the once found all matching cases it will create div blocks with the information inside it, in a list view and assign the ID of the div to the UID it gets back from the database.
database:
Users
--> Country
---->State
----->City
------>Post/ZipCode
------->UID
--------> Users informantion
Welcome to StackOverflow!
A great place to get started is the Firebase Realtime Database doocumentation or searching for Firecasts on YouTube (linked below).
As requested, here are some questions to ask yourself to get started and help scope out and define your new Firebase project.
What language are you going to use?
Are you planning on using any frameworks/libraries? e.g. For Javascript, these would include things like jQuery, Polymer, and React
What information are you storing in your database? e.g. user profiles, private user data/settings, public indexes, username lists, etc.
How is your database structured?
What data is being searched? The entire database? Values in a certain location?
What data needs to be displayed in your view?
Is the data accessible for just the current user or is it a public database that anyone can use?
What search criteria will be used? Is it just one filter at a time or many?
The answers to these questions aren't set in stone, but are to help you start thinking about the future of your project. They can be changed at any time as this isn't SQL where everything has to have its own schema.
If you intend on using "advanced searches" where you'll filter by multiple parameters at the same time, consider using Cloud Firestore instead.
I recommend looking at some Firecasts to help guide you through these questions. Here are some links to them:
Firebase YouTube Channel
Video: Getting Started with the Firebase Realtime Database on the Web
Playlist: Firebase on the Web
ok guys, im pretty confused with a class project i've been assigned. I need to make an app that allows the user to take a picture, and then send it to a database. I also need to create a webpage where all the pictures taken with the app will be shown. so, the user takes the picture with the app, and then it sends it to the page, where its displayed. I guess is something like a pseudo-instagram.
the part that really confuses me is the database/server part of the app. i think the app will send the pictures to the database, from where the website will retrieve the latest ones (or some other sorted way). after reading a little about databases i found couchbase and i think thats the way to go.
The part i dont really understand about couchbase is where is the data stored. does couchbase just gives me the database and i have to store all the information (photos) somewhere like a computer that acts as a server or in the cloud; or its stored in some kind of server provided by couchbase?
also, is what i described the way to go in this app? the basic idea is to send information from the app to a database/server and then retrieve that data to the webpage. any advice is truly appreciated. Thank you in advance.
couchbase provides key value store. Data is stored within the couchbase. In your case you need to store the images as value. CouchBase is capable of storing binary data. So, you probably want to convert your images in the binary data and store it.
CouchBase has great API, which you can query to retrive your images.
Not sure if this helps you. good luck with your project.
I am very new to Facebook applications and have very basic questions.
I use javascript SDK for my application, that loads friends' names and their profile pics.
How can I store this data into a MySQL database?
Since you want to store data in a databes you need to have the server process the information and put it there, thus a server script is required.
Most commonly people use php, so what you need to look at is how to get the data from facebook:
https://developers.facebook.com/docs/reference/php/
and then how to store the date you got from facebook:
http://www.w3schools.com/php/php_mysql_intro.asp
(you can do a google search there are loads of resources)
Keep the facebook guidelines on storing data in mind (not quite sure what they look like anymore)
Happy coding!
I want to create an online quiz website using Silverlight.
When the registered users are logged in, they can view and answer the quiz once per page.
To proceed to the next question, they must push next button, and the new data downloaded from the server.
The previous questions are not cached. Thereby everytime the question is requested, the question will be reloaded from the server again.
My question is how to do my scenario above in silverlight?
Thank you in advance.
Now that your intent is clear, you want to prevent discovery of the content in your assembly. The answer is you can't really protect your assembly. In order to run it the client needs to fetch it, if it can be fetched then the would be hacker can get it, trying to limit caching isn't really a prevention.
However the solution is to not put senstive stuff in your assembly to start with. Place code server side to do the sensitive stuff and access that code via a service interface such as WCF or Web services or even plain old XML in XML out posting.
You could use IsolatedStorage to store some state related info (and you can even encrypt it before you save if you want - it's your storage, do what you want with it). Another way to store state information is to use cookies, here and here.
The "state" information that i refer to is the state and/or progress of your Silverlight app, i.e. you can track where the user got to in the questions, and avoid requesting questions they have already completed. Both of these types of storage can be deleted by the end user, if they know what they are doing. But you shouldn't let that worry you - if they want to cheat, then let them.
Create the silverlight app to request the questions via a Web Service. As long as you're using a proper web service and not faking it in some way. The browser is not going to cache the webservice response.