d3.select("item"); - selects an element on the page. Stores much more than DOM
d3.selectAll("item"); - selects all items of a given element on a page
d3.select(this);
d3.select("svg").select("circle");
| require 'minitest/autorun' | |
| require 'minitest/pride' | |
| # Write a series of methods which use the .any, .all, .map, .select, .reject, and | |
| # .reduce methods in Enumerable. Each of your methods should be one line. | |
| def has_even?(arr) | |
| arr.any?(&:even?) | |
| end |
| require 'minitest/autorun' | |
| require 'minitest/pride' | |
| # Write modules which will be included in the classes below which will give | |
| # intelligent and bipedal behavior. | |
| # | |
| # You may not write any methods in the existing classes, but you may write | |
| # `include` statements in them. | |
| module Speak | |
| def say_name |
| Detailed Ruby Questions | |
| When would you use a hash instead of an array? | |
| An array would be used to store multiple values in an ordered list. A hash should be used when you | |
| need to store key value pairs. For example, if you were to store a person's information, putting it in | |
| an array would require that you remember the order that the information is stored in, and this could change | |
| as the information is changed or updated. Using a hash, however would allow you to store information by named keys. | |
| So, to access a person's phone number you could use person[:phone_number] instead of person[3]. | |
| When would you use a symbol instead of a string? |
| What command do you run if you want to discard all changes since your last commit? | |
| git stash | |
| What command do you use if you run git add and then want to revert it? | |
| git reset | |
| What command do you use if you run git commit and then want to revert it? | |
| git checkout **previous commit id** | |
| that other command that fixes detached head mode that I always have to google. |
| require 'minitest/autorun' | |
| require 'minitest/pride' | |
| # Write a method which returns the first n primes, where n is provided to the | |
| # method as a parameter. | |
| # | |
| # Remember that the % operator (modulo) is your friend. It returns a zero if one | |
| # number is divisible by another number. In other words, 4 % 2 == 0. | |
| # WRITE YOUR CODE HERE. Name your method `primes`. |
| require 'minitest/autorun' | |
| require 'minitest/pride' | |
| # Write a method which accepts an array as the first paramater and a number | |
| # as the second parameter. Return true if two of the numbers in the array sum | |
| # to the second parameter. | |
| def complements?(array, sum) | |
| return false unless array | |
| return false if array.length < 2 |
| password | |
| 123456 | |
| 12345678 | |
| 1234 | |
| qwerty | |
| 12345 | |
| dragon | |
| pussy | |
| baseball | |
| football |
| password | |
| 123456 | |
| 12345678 | |
| 1234 | |
| qwerty | |
| 12345 | |
| dragon | |
| pussy | |
| baseball | |
| football |