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
| class Linker: | |
| def __init__(self,name): | |
| self.name = name | |
| self.next = None | |
| def setNext(self,nex): | |
| self.next = nex | |
| def getNext(self): | |
| return self.next | |
| def getName(self): | |
| return self.name |
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 random | |
| class Linker: | |
| def __init__(self,name): | |
| self.name = name | |
| self.next = None | |
| def setNext(self,nex): | |
| self.next = nex | |
| def getNext(self): | |
| return self.next | |
| def getName(self): |
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
| 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): |
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 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) |
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
| 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) |
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
| 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 |
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
| //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; |
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 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; |
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 __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, |
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
| 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 |
OlderNewer