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
"" For the plugins, first run the command below: | |
" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
" Then open vim and type: | |
set clipboard=unnamedplus | |
set t_Co=256 | |
set updatetime=1000 | |
set linebreak | |
set encoding=utf-8 | |
set rtp+=$HOME/.vim/bundle/Vundle.vim | |
set incsearch |
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
create_table "people", force: :cascade do |t| | |
t.string "name", null: false | |
t.integer "house_id" | |
t.datetime "created_at", null: false | |
t.datetime "updated_at", null: false | |
t.index ["house_id"], name: "index_people_on_house_id", using: :btree | |
end |
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
class CreatePeopleTable < ActiveRecord::Migration[5.0] | |
def change | |
create_table :people do |t| | |
t.string :name, null: false | |
t.integer :house_id, null: false | |
t.belongs_to :house | |
t.timestamps | |
end | |
end |
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
def fibs_sum(n) | |
return 1 if n == 1 | |
return 2 if n == 2 | |
fibs_sum(n - 1) + fibs_sum( n - 2) + 1 | |
end |
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
def prime_factorization(num) | |
return [] if num == 1 | |
2.upto(num - 1).each do |factor| | |
if num % factor == 0 | |
return [factor] + prime_factorization(num / factor) | |
end | |
end | |
[num] | |
end |
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
Stein DONE | |
Nozick Bias DONE | |
Nozick Bundles DONE | |
Caplan 1 DONE | |
caplan 2 &4&mental illness | |
gore1 DONE | |
westen1 DONE | |
westen2 DONE | |
gore2 DO | |
Tea Partay DONE |
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
''' | |
File: hw19_Kallick.py | |
Author: Daniel Dyssegaard Kallick | |
Description:counts word frequency | |
''' | |
def word_frequency(filename): | |
"""Takes a filename(string) as a parameter, returns a dictionary of | |
word frequencies""" | |
fin=open(filename,'r') | |
wordlist=fin.read().split() |
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
def see(x): | |
return x[1] |
NewerOlder