https://lark.thinkful.com/grading/contacts/t:441869/assignments/2854/
- in - 10:15p
- out - 10:25p
# author: Alex Stout | |
# check if the provided argument is a directory | |
if [[ -d $1 ]]; then | |
: # nop -- do nothing | |
elif [[ -f $1 ]]; then # or is it a file | |
: # nop -- do nothing | |
else | |
echo "argument is invalid" | |
exit 1 |
https://lark.thinkful.com/grading/contacts/t:441869/assignments/2854/
https://lark.thinkful.com/grading/contacts/t:580421/assignments/2873/
Hi student,
No sweat. You're so close! It looks like you're not using flexbox which is definitely the recommended way to layout and center content. I'm going to give you a couple pieces because you're pretty much there. First, notice your pricing
element is overflowing. This is because you're unnecessarily providing width: 100%
, let's let the defaults handle the width here and remove that, . This will allow the width of width: 100%
pricing
to fill its parent without regard for the width of its own child content. Next, let's use flexbox by adding display: flex
to your pricing
element.
And voilà ! That should render your .pricing-tiers
within the .pricing
element. Does this look how it should? Definitely play around a bit with flexbox and let me know if you have anymore questions!
Hi student,
Welcome to one of modern web development's most polarizing debates!
According to Facebook, React is a JavaScript library. One way to think of a library is that a library is something that provides an interface to make your top-level design simpler and cleaner. I hope you are familiar with the design concept MVC (Model, View, Controller), if not, I enjoy this simple explanation from the perspective of web development.
Hi student,
SQL Injection is definitely a security flaw you'll always want to keep in mind when writing web applications that use SQL databases. SQL injection occurs when SQL queries are performed using standard string interpolation. Any language that supports SQL should also provide SQL libraries that provide methods to safely construct and execute SQL queries using some type of parameter sanitation method or parameter binding.
First, I'll show some examples of SQL injection in practice.
Hi student,
First, I'm glad to hear you're making progress learning Rails ActiveRecord
associations. Second, before you consider yourself stuck, I would always recommend seeking out code documentation. Most good modern software has helpful documentation that should be able to steer you in the right direction. The Rails documentation has a great example on has_many :through
associations. Let's use their example.
has_many
tells ActiveRecord
that we want each instance of this model to have associations to one or more instances of another model. Now imagine we want to simply access data of a third model that is referenced only by association of our referenced model from our first model (sorry that was a mouthful). This is where :through
comes into play. Consider the following:
class Physician < ApplicationRecord
Hi student,
Sure! This is actually a pretty common problem that everyone encounters at some point in web development. This is what is known as a "scope" issue. Scope is essentially the environment that is known to the software at a given time of execution. What is happening in your example, is that when your onclick
function is executed, it's a different scope than the prizes
and btnNum
variables. By the time the onclick
executes, prizes
and btnNum
are long gone. The onclick
function doesn't "know" about these variables. These variables are out of the scope of the onclick
function.
So to fix this, there are a few things you can do. I've written about a few of the other methods that could be used in some further reading, but for simplicity I only included the solution I would recommend here.
Here are a few solutions for when the onclick
function is trying to access out-of-scope data.
This one is probably the most confusing, but functions that return functions is a common practice in JavaScript, so it's something you'll want to get familiar with. You can create a function that knows the full scope of what you need and returns a unique function that calls the alert with a given text.
function getPrizeFunction(prizeText) {