Skip to content

Instantly share code, notes, and snippets.

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 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):
@M-Barnett
M-Barnett / sshpass.rb
Last active December 26, 2019 07:05 — forked from lalyos/sshpass.rb
brew install sshpass
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}"
@M-Barnett
M-Barnett / Problem-5
Created December 7, 2015 20:19
Code Challenge Problem 5
"""
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
@M-Barnett
M-Barnett / gist:bfaf20c2d7f9ef380423
Last active September 2, 2015 18:23
Recursive Summation
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