- RSpec
- Associations + validations
- Scopes
| def sort2(list) | |
| unsorted, sorted = list.dup, [] | |
| sorted[0] = unsorted.pop | |
| while unsorted.size > 0 | |
| val = unsorted.pop | |
| sorted.each_with_index do |s, i| | |
| if val <= s | |
| sorted.insert(i, val) | |
| break |
| # Time to complete: 40 minutes | |
| class Robot | |
| attr_accessor :position, :items, :health, :equipped_weapon | |
| def initialize | |
| @position = [0,0] | |
| @items = [] | |
| @health = 100 | |
| end |
| class Student | |
| attr_reader :first_name, :last_name, :courses_enrolled | |
| def initialize(first_name, last_name) | |
| @first_name = first_name | |
| @last_name = last_name | |
| @courses_enrolled = [] | |
| end | |
| def name |
| class KnightsPath | |
| def initialize(start, finish) | |
| @start = convert_chess_position(start) | |
| @finish = convert_chess_position(finish) | |
| @queue = [KnightNode.new(@start, nil)] | |
| end | |
| def find_path | |
| past_moves = [] |
| devise = yes?("Devise? ") | |
| cancan = yes?("Cancan? ") | |
| omniauth = yes?("Omniauth? ") | |
| foundation = yes?("Foundation? ") | |
| bootstrap = foundation ? false : yes?("Bootstrap? ") | |
| ember = yes?("Ember? ") | |
| handlebars = ember ? false : yes?("Handlebars? ") | |
| underscore = yes?("Underscore? ") | |
| homecontroller = yes?("Home Controller with index page? ") | |
| github = yes?("GitHub create and push? ") |
| -- JitBit SQL Interview Questions (Posted on Hacker News) | |
| -- http://www.jitbit.com/news/181-jitbits-sql-interview-questions/?utm_source=hackernewsletter&utm_medium=email | |
| -- Schema: | |
| -- employees table | |
| -- EmployeeID | |
| -- DepartmentID | |
| -- BossID | |
| -- Name | |
| -- Salary |
| # Will run rake in each folder, check how | |
| # many specs failed, and output scores | |
| # (passed specs of total specs) into | |
| # 'final_grades.txt' along with a note if | |
| # 'rake' errored out. | |
| # | |
| # | |
| # Expectations: | |
| # | |
| # Single folder that contains one folder |
| https://www.dropbox.com/s/2xuy5mhoqaxagbe/Drivers%20license.jpg |
| %load_ext autoreload | |
| %autoreload 2 | |
| # Exclude autoimports | |
| %aimport -np | |
| %aimport -pd | |
| %aimport -sp | |
| %aimport -sklearn | |
| %aimport -skimage | |
| %aimport -mpl |