Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

forAllBright forAllBright

🎯
Focusing
View GitHub Profile
View kill python processes
[innotec@innotec ~]$ ps aux | grep 'manage.py' | awk '{print $2}' | xargs kill -9
# add alias in .bashrc
# kill python processes
alias ppsk="pkill -f manage.py"
# or
[innotec@innotec ~]$ killall python
# or
alias pk="ps aux | grep 'manage.py' | awk '{print $2}' | xargs kill -9"
@forAllBright
forAllBright / win7-bootable-usb-on-osx.md
Created Dec 3, 2018
Create a Bootable Win7 USB Stick on OSX
View win7-bootable-usb-on-osx.md

Create a Bootable Win7 USB Stick on OSX

Prerequesites:

  • 4GB+ USB Stick
  • Windows 7 ISO from Microsoft downloaded to your OSX-Machine

Preparing the drive

  1. Open Disk utility
  2. Find the drive, format it with the following options:
  • Choose Master Boot Record (MBR)
View for 高级用法-不能动态删除元素.java
// 在 for 的高级用法中不能动态的删除集合元素。
public class Test {
public static void main(String[] args) {
ArrayList<String> str = new ArrayList<>();
str.add("h");
str.add("e");
str.add("ll");
str.add("o");
for(String i:str) {
if(i.equals("e")) {
@forAllBright
forAllBright / 添加标题行.py
Last active May 4, 2018
Python DataFrame基本操作 #Python #Pandas
View 添加标题行.py
# 读取 csv 文件,添加标题行
mobi = r"/Users/pmz/Project/MOBIKE_CUP_2017/225W.csv"
df = pd.read_csv(mobi,header=0,names=['time','number'])
print(df.head())
@forAllBright
forAllBright / time转stamp.py
Last active Nov 17, 2018
Python时间类型 #Python #TimeType
View time转stamp.py
#时间转为时间戳
def time_handle(time_in): #time_in is str type
d = datetime.datetime.strptime(time_in, "%m/%d/%Y %H:%M:%S")
x1 = time.mktime(d.timetuple()) #get the timestamp
return x1