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
## preview fzf | |
## prerequisites: | |
## - brew install fzf | |
## - (brew --prefix)/opt/fzf/install | |
pf () { | |
local dir=${1:-"."} # defaults to current directory if no argument is provided | |
local instructions="=== FILE SELECTION TOOL === | |
Multi-select: Press TAB |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 numpy import vectorize | |
def mysql_bit_to_bool(values): | |
"""Return Python [an array of] boolean values.""" | |
mysql_bits = {'\x01': True, '\x00': False} | |
def wrapper(value): | |
return mysql_bits[value] |
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 __future__ import division | |
from sympy import * | |
N = symbols('N', integer = True) | |
a = 45 | |
b = 60 | |
c = 20 | |
d = 85 | |
X = symbols('X') | |
eqs = ( | |
X - 2*N*(abs(a*d-b*c)-N)**2/((a+c)*(b+d)*N**2) |
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
class PostGres(object): | |
connection = None | |
def __init__(self, connection, debug_on=True): | |
self.connection = connection | |
self.autocommit = True | |
self.debug_on = debug_on | |
def get_table_count(self, table): |
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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:d2c68b4373fca3af6f3e771c8cdbccc2c8dd3c0fd7e82dd401199d6e0fa16c86" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
html(tab_list([[i,i.get_sign(),d[i],d[i].get_sign()] for i in d], headers = ['element',sign,'image',sign])) | |
def tab_list(y, headers = None): | |
''' | |
Converts a list into an html table with borders. | |
''' | |
s = '<table border = 1>' | |
if headers: | |
for q in headers: | |
s = s + '<th>' + str(q) + '</th>' |