This file contains 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 types | |
import typing | |
import ast | |
import inspect | |
class TypeViolationError(TypeError): | |
def __init__(self, variable_name, expected_type, actual_type): | |
super().__init__() | |
self.variable_name = variable_name |
This file contains 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 types | |
import typing | |
import ast | |
import inspect | |
class TypeViolationError(TypeError): | |
def __init__(self, variable_name, expected_type, actual_type): | |
super().__init__() | |
self.variable_name = variable_name |
This file contains 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 numpy as np | |
def matrix_sqrt(A): | |
'''Solve for B in A = B*B''' | |
# B can be decomposed into V * S * V.I where S is diagonal and V is a column | |
# matrix of the eigenvectors (provided it meets certain criteria, but that | |
# probably won't happen). | |
V = np.matrix(np.linalg.eig(A)[1]) # Returns eigenvalues and eigenvectors | |
VI = V.I |
This file contains 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 OrderedDict | |
class enummeta(type): | |
def __init__(cls, name, bases, classdict): | |
super(enummeta, cls).__init__(name, bases, classdict) | |
cls.__values__ = [v for v in classdict.values() if v not in (__name__, enummeta)] | |
def __iter__(cls): | |
return iter(cls.__values__) |
This file contains 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 OrderedDict, MutableMapping, ItemsView | |
class ordereddefaultdictwithkey(MutableMapping, ItemsView): | |
def __init__(self, factory_func): | |
self.__factory_func = factory_func | |
self.__dict = OrderedDict() | |
def __len__(self): | |
return len(self.__dict) |
This file contains 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
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE DeriveFoldable #-} | |
{-# LANGUAGE DeriveTraversable #-} | |
module Main where | |
import System.Directory | |
import System.FilePath | |
import System.Environment | |
import Data.List (intercalate, isPrefixOf) |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>comment</key> | |
<string>Failcoder - Theme</string> | |
<key>name</key> | |
<string>Failcoder "failcoder.com"</string> | |
<key>semanticClass</key> | |
<string>theme.failcoder</string> |
This file contains 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
<dict> | |
<key>name</key> | |
<string>CSV Commas</string> | |
<key>scope</key> | |
<string>punctuation.comma.csv</string> | |
<key>settings</key> | |
<dict> | |
<key>foreground</key> | |
<string>#df9f2c</string> | |
</dict> |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>csv</string> | |
</array> | |
<key>name</key> | |
<string>CSV</string> |