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 threading import Thread | |
| from Queue import Queue | |
| class ThreadPool(object): | |
| # Nested private worker class | |
| class Worker(Thread): | |
| def __init__(self, queue): |
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
| #!/bin/bash | |
| package="$1" | |
| version="$2" | |
| curl -X GET http://127.0.0.1:5000/package/$package/$version |
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
| """ htool :: Haskell Tool | |
| Module of borrowed operators from Haskell implemented in Python for the purpose | |
| of gaining more familiarity with functional programming in a familiar | |
| environment. | |
| """ | |
| __author__ = 'CjHanks' | |
| __license__ = 'Free' | |
| from operator import lt, gt |
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 signal import signal, SIGUSR1 | |
| from traceback import format_stack | |
| from sys import stderr | |
| def dump_frame(sig, frame): | |
| if sig is SIGUSR1: | |
| stderr.write(''.join(format_stack(frame))) | |
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
| INIT |
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 python2 | |
| from sys import argv | |
| from fnmatch import fnmatch | |
| from boto.ec2 import connect_to_region | |
| pattern = '*' if 1 is len(argv) else argv[1] | |
| machines = [] |
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 copy import copy | |
| from random import shuffle | |
| d = [ 0, 1, 2, 3, 4 ] | |
| T = 0 | |
| F = 0 | |
| for i in range(0, 10000): |
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 python2 | |
| """ | |
| :author: CjHanks <develop@cjhanks.name> | |
| Usage: cvgrind module {optional_entry_point} | |
| # Will call | |
| import module | |
| # -- optionally -- | |
| module.optional_entry_point() |
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 Parent(object): | |
| def method(self, *args, **kwargs): | |
| raise NotImplementedError('NOT DONE') | |
| @classmethod | |
| def impl_method(Cls, data): | |
| print(Cls, data) | |
| class Child1(Parent): |
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
| """ | |
| http://www.careercup.com/question?id=5127611667709952 | |
| """ | |
| RowSize = 5 | |
| Data = [['a', 'b', 'c', 'd', 'e'], | |
| ['f', 'g', 'h', 'i', 'j'], | |
| ['k', 'l', 'm', 'n', 'o'], | |
| ['p', 'q', 'r', 's', 't'], | |
| ['u', 'v', 'w', 'x', 'y'], |