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
| found = False | |
| def solve(results, parts, sums, idx): | |
| global found | |
| if found: | |
| return True | |
| if sums == results: | |
| found = True |
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
| # Doxyfile 1.8.9 | |
| #--------------------------------------------------------------------------- | |
| # Project related configuration options | |
| #--------------------------------------------------------------------------- | |
| DOXYFILE_ENCODING = UTF-8 | |
| PROJECT_NAME = "Cameron & Wilding Tool" | |
| PROJECT_NUMBER = | |
| PROJECT_BRIEF = "Drupal 7 Architecture tool" | |
| PROJECT_LOGO = /Users/itarato/Desktop/logo.png |
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 System.IO | |
| import Control.Monad | |
| solve_v1 :: [Int] -> Int | |
| solve_v1 (a:[]) = 0 | |
| solve_v1 (a:b:c) = (if a > b then a - b else 0) + (solve_v1 (b:c)) | |
| min_dist :: [Int] -> Int | |
| min_dist (a:[]) = 0 | |
| min_dist (a:b:c) = if a > b then max (min_dist (b:c)) (a - b) else min_dist (b:c) |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| def plot_result(O): | |
| sample_size = 50 | |
| linX = np.linspace(np.min(npdata[:,1]), np.max(npdata[:,1]), num=sample_size) | |
| testX = np.concatenate((np.ones((sample_size, 1)), linX.reshape((sample_size, 1))), axis=1) | |
| y = np.dot(testX, O) | |
| plt.plot(linX, y[:,0], 'r-') |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| def plot_result(O): | |
| sample_size = 50 | |
| linX = np.linspace(np.min(npdata[:,1]), np.max(npdata[:,1]), num=sample_size) | |
| testX = np.concatenate((np.ones((sample_size, 1)), linX.reshape((sample_size, 1))), axis=1) | |
| y = np.dot(testX, O) | |
| plt.plot(linX, y[:,0], 'r-') |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| if __name__ == '__main__': | |
| fin = file('logreg.txt', 'r') | |
| npdata = np.genfromtxt(fin, delimiter=',') | |
| posData = npdata[npdata[:,2] == 1,:] | |
| negData = npdata[npdata[:,2] == 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
| import numpy as np | |
| class NeuralNetwork: | |
| def __init__(self, data, layer_sizes): | |
| """ | |
| :param data: (M)x(N+1) matrix of inout data, Y is in last column. | |
| :param iteration: Iteration count for training. | |
| """ | |
| self.data = data |
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
| package main | |
| import ( | |
| "bytes" | |
| "io/ioutil" | |
| "log" | |
| ) | |
| func temp(...interface{}) {} |
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
| package main | |
| import ( | |
| "log" | |
| ) | |
| var ( | |
| n int = 8 | |
| l []int = make([]int, n*2) | |
| used map[int]bool = make(map[int]bool) |
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 turtle | |
| limit = 6 | |
| frac = 0.8 | |
| def draw(size, inv = False): | |
| if size > limit: | |
| t.lt(90) |