π
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
# coding=utf-8 | |
import httplib, urllib, json | |
import locale, datetime | |
import base64, hmac | |
from hashlib import sha1 | |
gid = 'sh600580' | |
apihub_key = 'YSBYsT2nNVBNykK1' |
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
function s=TimeStamp | |
strcat(datestr(clock,'yyyy-mm-dd-HHhMM'),'m',datestr(clock,'ss'),'s') | |
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
XTickLabel = get(gca,'XTickLabel'); | |
set(gca,'XTickLabel',' '); | |
hxLabel = get(gca,'XLabel'); | |
set(hxLabel,'Units','data'); | |
xLabelPosition = get(hxLabel,'Position'); | |
y = xLabelPosition(2); | |
XTick = get(gca,'XTick'); | |
y=repmat(y,length(XTick),1); | |
fs = get(gca,'fontsize'); | |
hText = text(XTick, y, ... XTickLabel,'fontsize',fs); |
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 os, sys | |
import re | |
in_fd = open('reference.bib', 'r') | |
out_fd = open('test.bib', 'a') | |
p = '\{(.*)\}' | |
for line in in_fd.readlines(): | |
if line.find('author') > -1 or line.find('AUTHOR') > -1: |
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 subprocess | |
with open("stdout.txt","wb") as out, open("stderr.txt","wb") as err: | |
subprocess.Popen("ls",stdout=out,stderr=err) |
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
#!/usr/bin/python | |
import os, sys | |
import subprocess | |
procs = [] | |
with open(sys.argv[1], 'r') as f: | |
for line in f.readlines(): | |
if line.find("host1") > -1: |
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
#!/usr/bin/python | |
import os, sys | |
import subprocess | |
# argv[1] analysis directory | |
if len(sys.argv) == 1: | |
print """ | |
- argv[1] analysis directory |
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
#!/usr/bin/python | |
# Author: [email protected] | |
import os, sys | |
import subprocess | |
# | |
# Copy this script to the directory containing submission packages | |
# excute python ext_convt.py . | |
# |
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 Solution(object): | |
def containsNearbyAlmostDuplicate(self, nums, k, t): | |
""" | |
:type nums: List[int] | |
:type k: int | |
:type t: int | |
:rtype: bool | |
""" | |
if not nums: | |
return False |
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
#!/usr/bin/python | |
import os | |
import sys | |
import subprocess | |
import argparse | |
import re | |
import socket | |
# argv[1] host lists | |
# argv[2] source file/directory |
OlderNewer