Skip to content

Instantly share code, notes, and snippets.

View Chelimin's full-sized avatar

Catherine He Chelimin

View GitHub Profile
from collections import defaultdict
food_list = 'spam spam ham ham ham spam eggs spam'.split()
counter = defaultdict(int) # default value of int is 0
for food in food_list:
counter[food] += 1 # increment element's value by 1
print counter
# word_counts = counter.items()
@Chelimin
Chelimin / user_controller_rspec
Created July 13, 2016 12:51
User controller rspec for Devise
require 'rails_helper'
describe UsersController, :type => :controller do
before do
@user = User.create!(email: "test@email.com", password: "test123")
end
describe "GET #show" do
context "User is logged in" do
before do

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.