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 std.stdio; | |
import Dgame.Window; | |
import Dgame.Graphic; | |
import Dgame.System.StopWatch; | |
import Dgame.System.Font; | |
import Dgame.System.Keyboard; | |
interface Entity { |
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 pandas | |
import numpy | |
def resampled_data(query, date_col, target_col, period="M"): | |
""" Function that takes an sql query and returns the sum of a target column | |
by a period. Useful for getting monthly data | |
""" | |
df = pandas.read_sql(query, conn) | |
df.set_index(df[date_col], inplace=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 PIL import Image | |
def autorotate(path): | |
""" This function autorotates a picture based upon its EXIF data | |
because smartphones use a little used EXIF option to set the | |
rotation of an image rather than save the data in that orientation | |
""" | |
image = Image.open(path) | |
try: |
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
#sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; } |
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 mongo_to_dict(obj): | |
""" Turn a mongoengine object into a jsonible python object | |
""" | |
return_data = [] | |
if isinstance(obj, db.Document): | |
return_data.append(("id", str(obj.id))) | |
for field_name in obj._fields: |
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
<?php | |
$connection = odbc_connect("YOURCONNECTION", "", ""); | |
$result = odbc_tables($connection); | |
$tables = array(); | |
while (odbc_fetch_row($result)) | |
{ | |
if(odbc_result($result,"TABLE_TYPE")=="TABLE") | |
{ |
NewerOlder