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
| #!/bin/python | |
| import sys | |
| def combinations_sum(n): | |
| k = n/2 | |
| combs = [] | |
| answers = [] | |
| for i in range(0,k+1): | |
| a,b = i, n-i |
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
| # load contents of text file into a list | |
| # numList | |
| NUMLIST_FILENAME = "IntegerArray.txt" | |
| inFile = open(NUMLIST_FILENAME, 'r') | |
| with inFile as f: | |
| numList = [int(integers.strip()) for integers in f.readlines()] | |
| count = 0 |
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
| Boston July Temperatures | |
| ------------------------- | |
| Day High Low | |
| ------------ | |
| 1 91 70 | |
| 2 84 69 | |
| 3 86 68 | |
| 4 84 68 |
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
| import pylab | |
| def loadfile(): | |
| inFile = open('julyTemps.txt', 'r') | |
| high =[]; low = [] | |
| for line in inFile: | |
| fields = line.split() | |
| if len(fields) < 3 or not fields[0].isdigit(): | |
| pass | |
| else: |
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
| import pylab | |
| import numpy as np | |
| def loadFile(): | |
| inFile = open('julyTemps.txt') | |
| high = [];vlow = [] | |
| for line in inFile: | |
| fields = line.split() | |
| if len(fields) != 3 or 'Boston' == fields[0] or 'Day' == fields[0]: | |
| continue |
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
| # Code for the merge subroutine | |
| def merge(a,b): | |
| """ Function to merge two arrays """ | |
| c = [] | |
| while len(a) != 0 and len(b) != 0: | |
| if a[0] < b[0]: | |
| c.append(a[0]) | |
| a.remove(a[0]) | |
| else: |
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
| 5r ii*?} @?_ t@jie @e!f| i?qf^ f?rfq ir 5r ii* | |
| i?q|e r|i? ? t?_i?fq@d ,_f?rf rei4 @? k? q @* i*r) | |
| , qfe4f?| | |
| ,q| fe # i | |
| t | |
| abstract | |
| between 4<:6 and 4<:;/ the indonesian government constructed over 94/333 primar| | |
| schools throughout the countr|1 this is one of the largest school construction programs on | |
| record1 i evaluate the eect of this program on education and wages b| combining dierences | |
| across regions in the number of schools constructed with dierences across cohorts induced |
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
| 5U LL*?} @?_ w@MLh @h!i| L?ti^ i?Uit Lu 5U LL* | |
| L?t|h U|L? ? W?_L?it@G ,_i?Ui uhL4 @? N? t @* L*U) | |
| , Tih4i?| | |
| ,t| ih # L | |
| W | |
| Devwudfw | |
| Ehwzhhq 4<:6 dqg 4<:;/ wkh Lqgrqhvldq Jryhuqphqw frqvwuxfwhg ryhu 94/333 sulpdu| | |
| vfkrrov wkurxjkrxw wkh frxqwu|1 Wklv lv rqh ri wkh odujhvw vfkrro frqvwuxfwlrq surjudpv rq | |
| uhfrug1 L hydoxdwh wkh hhfw ri wklv surjudp rq hgxfdwlrq dqg zdjhv e| frpelqlqj glhuhqfhv | |
| dfurvv uhjlrqv lq wkh qxpehu ri vfkrrov frqvwuxfwhg zlwk glhuhqfhv dfurvv frkruwv lqgxfhg |
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
| from string import * | |
| # create decipher dictionary | |
| l = letters[:26] | |
| decipher = "".join([l[(i+3)%26] for i in range(len(l))]) | |
| decipher = dict(zip(decipher,l)) | |
| # open and read encrypted text | |
| filename = 'estherDuflo.txt' | |
| f = open(filename, 'rw') |
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
| procedure karatsuba(num1, num2) | |
| if (num1 < 10) or (num2 < 10) | |
| return num1*num2 | |
| /* calculates the size of the numbers */ | |
| m = max(size_base10(num1), size_base10(num2)) | |
| m2 = m/2 | |
| /* split the digit sequences about the middle */ | |
| high1, low1 = split_at(num1, m2) | |
| high2, low2 = split_at(num2, m2) | |
| /* 3 calls made to numbers approximately half the size */ |