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
server { | |
listen 8000; | |
server_name 127.0.0.1; | |
location /static/ { | |
alias /root/SWE/static/; | |
autoindex on; | |
} | |
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
path = wx.FileSelector("Open") | |
path = wx.DirSelector() |
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
"use strict"; | |
var AjaxForm = (function() { | |
var hasSetup = false; | |
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { |
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
# Copyright (c) Peter Astrand <[email protected]> | |
class BackwardsReader: | |
"""Read a file line by line, backwards""" | |
BLKSIZE = 4096 | |
def readline(self): | |
while 1: | |
newline_pos = string.rfind(self.buf, "\n") | |
pos = self.file.tell() |
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
abc = None | |
cba = None | |
def set_abc(value): | |
global abc | |
abc = value | |
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 win32clipboard | |
import win32con | |
def getText(): | |
win32clipboard.OpenClipboard() | |
d = win32clipboard.GetClipboardData(win32con.CF_TEXT) | |
win32clipboard.CloseClipboard() | |
return d | |
def setText(aString): |
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
#coding=utf8 | |
import cookielib | |
import urllib2, urllib | |
import time | |
import re | |
import traceback | |
import time | |
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 get_rsa_sign(data, private_key=PRIVATE_KEY): | |
# pip install pyopenssl | |
from OpenSSL.crypto import load_privatekey, FILETYPE_PEM, sign | |
import base64 | |
keys = sorted(data) | |
kstr = '' | |
for key in keys: |
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 as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
df = pd.read_csv('pandasTest.csv') | |
print(df) | |
print('================================================================') |
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 import_data(request): | |
data = request.FILES.get('data') | |
book = xlrd.open_workbook(data.name, file_contents=data.read()) | |
sheet = book.sheets()[0] | |
names = sheet.col_values(1, 1) | |
stocks = sheet.col_values(5, 1) | |
dates = sheet.col_values(22, 1) | |
for name, stock, date in zip(names, stocks, dates): |