Skip to content

Instantly share code, notes, and snippets.

View bowbahdoe's full-sized avatar

Ethan McCue bowbahdoe

View GitHub Profile
'''
Module containing all libwallaby functions
'''
def import_funcs(name):
'''
cheap hack to import all functions from submodules to global namespace
'''
modu = __import__(name, globals(), locals())
attributes = dir(modu)
for i in attributes:
#!/usr/bin/env python
'''
module for regularly sending certain files to a remote host
'''
# For the transferring of files
import pysftp
# For filewalking, as needed for image files
import os
update_asset = function(old_asset, updated_asset){
for (var property in old_asset) {
if (old_asset.hasOwnProperty(property) {
old_asset[property] = new_asset[property]
}
}
old_asset.save(function(err){
//handle possible error
from __future__ import division, print_function
import csv
def get_weight(text_importance):
'''returns the integer value of the
text based importance rating'''
imp = {"Irrelevant":0,
"A Little Important":1,
"Somewhat Important":10,
package net.mineplus.beefjerky97;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
//provided for us
import java.util.Scanner;
public class SevenDriver{
public static void main(String[] args){
System.out.println("Enter number of dice to toss");
Scanner s = new Scanner(System.in);
int diceCount = s.nextInt();
SevenTally t = new SevenTally(diceCount);
int experiments = 1000000;
int wins = 0;
float evaluatePolynomial(int array[],
int arrayLength,
float xValue)
{
//Evaluates the polynomial at a given point
//So if you get passed in {1,2,3}, thats
//the same as X^2+2X+3 and {1,4,4,6,7,8}
//is X^5+4X^4+4X^3+6X^2+7X+8
//So {1,2,3},3,3.4 should return the result
int sumDigits(int number)
{
if(number<0)
{number=-number;}
else if(number == 0)
{return 0;}
int sum = 0;
while(number>0)
{
if(number%10==0)
from random import choice, sample,shuffle
class Deck:
def __init__(self):
self.cards = []
self.populate()
def populate(self):
for suit in range(4):
for value in range(1,14):
self.cards.append(Card(suit,value))
# print len(self.cards)
def sumDigits(number):
stringRepresentation = str(number)
total = 0
if(number < 10):
return number
for digit in stringRepresentation:
total += int(digit)
return sumDigits(total)
def main():
while(True):