I hereby claim:
- I am sarahelizgray on github.
- I am sarah_pw (https://keybase.io/sarah_pw) on keybase.
- I have a public key whose fingerprint is 112E E229 A8E3 A4F1 4400 C7A5 CDAE 82FE 9633 81CC
To claim this, I am signing this object:
set -e | |
FILE_1=$1 | |
echo $FILE_1 | |
git checkout restore-old-specs -- spec/lib/$FILE_1 | |
git rm spec.old/lib/$FILE_1 | |
rspec spec/lib/$FILE_1 --out test_results.txt | |
cat test_results.txt |
set -e | |
FILE_1=$1 | |
echo $FILE_1 | |
git checkout restore-old-specs -- spec/lib/$FILE_1 | |
git rm spec.old/lib/$FILE_1 | |
rspec spec/lib/$FILE_1 |
from sys import argv | |
#take in the script name and file name from the commandline | |
script, error_filename, dir_filename = argv | |
#print the filename entered by the user | |
print "Here's your file %r:" % error_filename | |
#open the filename submitted via raw input | |
error_collector = set() | |
with open(error_filename) as f: |
#modifying the stackoverflow answer you found at: | |
# http://stackoverflow.com/questions/19697846/python-csv-to-json | |
import csv | |
with open('test.csv') as csvfile: | |
reader = csv.DictReader(csvfile) | |
#now reader has all of the rows in the csv mapped to to the column headers | |
for row in reader: | |
for k,v in row.items(): |
I hereby claim:
To claim this, I am signing this object:
def is_prime(n): | |
#get all of the numbers from 2 to n - 1 | |
list_of_nums = range(2, n - 1) | |
#iterate through them one at a time | |
for index in list_of_nums: | |
#list_of_nums[index] tells us which item in the list we are checking | |
if n % index == 0: | |
# found a factor, so return false | |
print "found a factor" + index | |
return False |
def is_prime(n): | |
list_of_nums = range(2, n - 1) | |
array_index = 0 | |
while array_index < len(list_of_nums): | |
#check for common factor | |
elif n % list_of_nums[array_index] == 0: | |
return False | |
#try again | |
else: | |
array_index = array_index + 1 |
def sim_distance(prefs, person1, person2): | |
matches={} | |
for title in prefs[person1]: | |
print "looking at title " + title | |
if title in prefs[person2]: | |
matches[title]=1 | |
print "found a match " + title | |
print 'all done!' | |
print matches |
from sys import argv | |
#take in the script name and file name from the commandline | |
script, input_file = argv | |
# a helper method the prints the entire content of the file | |
def print_all(f): | |
print f.read() | |
# helper method that rewinds the file to the beginning |
from sys import argv | |
#take in the script name and file name from the commandline | |
script, filename = argv | |
#print the filename entered by the user | |
print "Here's your file %r:" % filename | |
#open the file | |
txt = open(filename) | |
#print the contents of the file |