This file contains 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 | |
class Mandelbrot(object): | |
def __init__(self): | |
n = 500 | |
self.n = n | |
self.grid = np.zeros((n,n)) | |
x = np.linspace(-2.025, 0.6, n) |
This file contains 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
""" | |
This code is to set up a class that represents nuclei in a 2D-array | |
""" | |
import random | |
import numpy as np | |
class Grid2D(object): | |
"""grid set representing nuclei""" | |
def __init__(self, dims, decay, time): |
This file contains 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
require 'formula' | |
class Sshpass < Formula | |
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz' | |
homepage 'http://sourceforge.net/projects/sshpass' | |
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
"--prefix=#{prefix}" |
This file contains 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
""" | |
Problem 5: | |
Write a program that outputs all the possibilities to put + or - or nothing between | |
the numbers 1,2,...,9 (in this order) such that the result is always 100. For | |
example: 1 + 2 + 34 - 5 + 67 - 8 + 9 = 100 | |
""" | |
# Creates the combinations to be tested |
This file contains 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 summation_recursion(submit_list, output = 0): | |
given_list = submit_list | |
if len(given_list) > 0: | |
output += given_list.pop() | |
summation_recursion(given_list, output) | |
else: | |
return output |