Created
September 15, 2016 03:13
-
-
Save ldco2016/f306fa205e263f99b4fe961570f9f9df to your computer and use it in GitHub Desktop.
Full Stack Mentor - Assessment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaScript | |
Hey mentor, | |
I was working through an assignment last night and came across a bug. I'm so confused! | |
The text in the alert is showing up as "undefined" instead of either "A Unicorn", "A hug", or "Fresh Laundry" and I'm not quite sure what's going on. Can you point me in the right direction? | |
-Student | |
Greetings Student | |
In Javascript you can get an undefined if the variable is not assigned, from viewing your code it appears your variables are defined as far as I can tell. Another reason why a function may return undefined is because a value was not returned. | |
I will reproduce your code and see what I get, but in the meantime, check out this documentation and let me know if you figure it out before I do: | |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined | |
Happy Coding, | |
Mentor | |
Rails | |
Hey mentor, | |
I am starting to understand associations, but I'm still confused about through. What's the practical difference between a has_many and a has_many :through? What about has_one :through? When do I use them? | |
-Student | |
Hey Student! | |
Has_many :through is when you are doing a many-to-many association and has_many is when you are doing a one-to-many association. | |
There is actually a wonderful resource where you can read more about it here: | |
http://guides.rubyonrails.org/association_basics.html | |
Let me know if your comprehension improves after looking over the documentation and reading my response. If not, we can talk more and perhaps I may need to do a powerpoint or youtube video for you on this topic. | |
Best wishes, | |
-Mentor | |
SQL | |
Hey mentor, | |
Thanks for the lecture yesterday, it really helped me get motivated again. I've been working through this assignment about databases and I'm confused about "SQL injection." What does that mean and how does it work? How do I prevent it in my apps? | |
Thanks! | |
-Student | |
Hey Student, | |
Thank you for the compliment on my lecture. SQL refers to an attack where malicious queries are "injected". This is done as a way to bypass user authentication and gain access. | |
Here is a resource by OWASP that gives you a more robust answer to what SQL injection is, how it works and how to protect yourself from it. | |
https://www.owasp.org/index.php/SQL_Injection | |
Happy Coding, | |
Mentor | |
Angular/jQuery | |
Hey mentor, | |
I'm really excited about starting on learning Angular. I'm having a problem understanding what angular is. Up until this point we've used jQuery, which we've called a library. Now we are using Angular, which is a framework. What's the difference? What are the drawbacks/benefits of using a framework like Angular vs a library like jQuery? | |
-Student | |
Greetings Student, | |
jQuery as a library means it adds features and functionality to your "vanilla" Javascript application which calls jQuery into action when needed. Angularjs is a certain way to structure javascript code to solve a particular problem. In the case of Angularjs, that problem being the impedance mismatch that is the mismatch between static and dynamic code which prevents the application from functioning as intended. | |
There is documentation I want you to read through here: | |
https://docs.angularjs.org/guide/introduction | |
After you have read it, write back and let me know what you could and could not understand and we can go over it together. | |
Happy coding, | |
Mentor | |
Algorithms | |
Hey mentor, | |
I hope you're doing well. I'm really enjoying learning algorithms, but I'm pretty confused by this Big O Notation thing. Can you explain how I'm supposed to figure out which notation my algorithm uses? | |
-Student | |
Hey Student, | |
I professional background is very limited when it comes to algorithms, but it is an important concept to learn especially if you want to learn how cryptocurrencies work for example. | |
I am providing a resource here written by Rob Bell: | |
https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/ | |
Go ahead and read through that and I will too and see if this helps you. If not, let me know and we can go over it together. | |
Happy coding, | |
Mentor | |
Hey mentor, | |
I'm having a really hard time with some CSS. I've been given a PSD in an assignment. I know what the document should look like, but I'm getting this instead. | |
Can you help me with this? Here is my code! | |
-Student | |
Hey Student, | |
Okay, so after quickly looking through your code, the first thing I noticed is that in your html you do not have a link to your stylesheet. This would typically go in the <head></head> tags and it would look like this <link href="styles.css" rel="stylesheet"> | |
In your case you want to replace style.css with whatever name you gave your stylesheet. Let me know how that goes and if you are still having problems send me the updated version of your code and I will attempt to reproduce it from my end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment