I want to talk for a moment about how to scale databases. Now, like databases themselves, this is a very broad topic, but there’s a couple concepts I’d like to introduce because they’re going to affect us in this class. There’s two reasons you might need to scale a database.
Caching refers to storing the result of an operation so that future request return faster. Basically, if you do something once you know whether it’s a database query or rendering some HTML or you know, anything that might be slow. You store the results so you don’t have to do
Okay, one last function to write. This is to determine if what the user entered for the year is valid.
Okay, time for a quiz. What I’d like you to do is write a function that, given input from the user, returns whether or not it is a valid month.
The answer is: it’s after the HTTP request headers. Let me show you how to find that out. So first we’ll go to our Editor and we’ll switch these lines around again so we can see the actual request. So I comment these two guys out, and I uncomment these
Next, I’d like you to write a function that, given what the user types in for the day, returns whether that day is valid or not.
We’re back in our editor, and we have our app that if the submission is not valid, we just rewrite the form out, and if it is valid, we say, Thanks! Now let’s work on this invalid case. Let’s make that a little bit more friendly. The first thing we
Okay, so the correct answer is for the title, we’re going to use a string. For the art, we’re also going to use a string, and for the created, we’re also going–we’re going to use a date time. Now, actually I lied to you, we’re not going to use a
What I’d like to do now is add this to our file that we’ve been editing. So we already have an input tag here, let’s add that name parameter. Let’s go to our browser now, we’ll reload, you can see our input box hasn’t changed. We added a name attribute
What will “q’s” value in the URL be when we submit our form with “the number one” selected from our Dropdown? Is it “the number one”–the string? Is it the numeral “1”–the digit? Does nothing appear or does the string, “hunter2” appear?