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 InvalidInput(Exception): | |
| pass | |
| def possible_combinations(attributes): | |
| """Takes in a user_attribute like described above, and returns | |
| all possible combinations of 1 of each of the attributes | |
| Every attribute has a list | |
| Returns: |
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 | |
| def merge(lista, listb): | |
| pa = 0 | |
| pb = 0 | |
| result = [] | |
| while True: | |
| if lista[pa] <= listb[pb]: | |
| result.append(lista[pa]) |
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 | |
| def partition(_list, pivot): | |
| '''Given a list and a pivot, returns 3 lists: | |
| low, [pivot], and high | |
| ''' | |
| pointer = 0 | |
| low = [] | |
| high = [] |
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 collections import deque | |
| import random | |
| class InvalidOperation(Exception): | |
| pass | |
| class Node(object): | |
| def __init__(self, data, left=None, right=None, parent=None): |
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
| #!/usr/bin/env python | |
| # Takes in a file as an input, and creates a file with the same name | |
| # with the suffix ".clean" | |
| __author__ = 'Nicholas Charriere' | |
| __VERSION__ = 0.1 | |
| import argparse | |
| import sys | |
| import json |
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 objsets | |
| /** | |
| * A class to represent tweets. | |
| */ | |
| class Tweet(val user: String, val text: String, val retweets: Int) { | |
| override def toString: String = | |
| "User: " + user + "\n" + | |
| "Text: " + text + " [" + retweets + "]" | |
| } |
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
| Verifying I am +nichochar on my passcard. https://onename.com/nichochar |
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 Node(): | |
| def __init__(self, next_node=None, previous_node=None, data=None): | |
| self.next_node = next_node | |
| self.previous_node = previous_node | |
| self.data = data | |
| class LinkedList(): | |
| def __init__(self, node): |
NewerOlder