zzp's blog


  • 首页

  • 分类

  • 归档

  • 搜索

调试Python程序工具(pdb, cProfile, pstats)

发表于 2018-09-06 | 分类于 python | 阅读次数

pdb

阅读全文 »

内网穿透FRP使用方法

发表于 2018-09-03 | 分类于 linux | 阅读次数

frp/README_zh.md at master · fatedier/frp

公网服务器server端

1
./frps -c ./frps.ini

frps.ini

1
2
3
4
# frps.ini
[common]
bind_port = 7000
vhost_http_port = 8080
阅读全文 »

下载github repo的子文件夹

发表于 2018-08-22 | 分类于 linux | 阅读次数

https://github.com/tensorflow/models/tree/master/research/inception

https://github.com/tensorflow/models/trunk/research/inception

replace
“tree/master” with “trunk”

1
svn checkout https://github.com/tensorflow/models/trunk/research/inception

linux bash colorful log.

发表于 2018-06-19 | 分类于 linux | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash

# Check for root
if [[ "$(id -u)" == "0" ]]
then
echo "$fail Do not run this script as root."
exit 1
fi

disableColor=""

if [[ $disableColor == "" ]] || [[ $disableColor == false ]]
then
fail="[$(tput setaf 1) FAIL $(tput sgr0)]"
ok="[$(tput setaf 2) OK $(tput sgr0)]"
running="[$(tput setaf 3) ** $(tput sgr0)]"
notice="[$(tput setaf 3)NOTICE$(tput sgr0)]"
warn="[$(tput setaf 3) WARN $(tput sgr0)]"
info="[$(tput setaf 6) INFO $(tput sgr0)]"
finish="[$(tput setaf 4) DONE $(tput sgr0)]"
elif [[ $disableColor == true ]]
then
fail="[ FAIL ]"
ok="[ OK ]"
running="[ ** ]"
notice="[NOTICE]"
warn="[ WARN ]"
info="[ INFO ]"
finish="[ DONE ]"
else
echo "Unknown disableColor setting."
exit 1
fi

echo "$fail this is fail."
echo "$ok this is OK."
echo "$running this is running."
echo "$notice this is notice."
echo "$warn this is warn."
echo "$info this is info."
echo "$finish this is finish."

music-recommendation

发表于 2018-06-10 | 分类于 ai | 阅读次数

sklearn CCA python

http://scikit-learn.org/stable/modules/generated/sklearn.cross_decomposition.CCA.html

跨平台的音乐推荐算法

http://media.people.com.cn/n1/2017/0113/c409702-29021998-2.html

openSMILE音频情感分析

1
./SMILExtract -C config/paraling\ IS10.conf -I example-audio/opensmile.wav -O opensmile.csv

特征结果存放在最后一行~

screen命令

发表于 2018-06-05 | 分类于 linux | 阅读次数

##1. 进入screen,

1
screen

##2. 列出所有id的session

1
screen - ls

##3. 切换到某id的session

1
screen -r (id)

##4. 新建某id的session

1
screen -S id

##5. 杀死某个id的session

1
screen -S id -X quit

##6. 切换出screen
ctrl+a+d

##7. 切换到下一个id的session
ctrl+a+n

改session名字

ctrl+A
:sessionname newname

在screen的session内,ctrl+a+:,可键入命令

escape ^Bb

临时改变主键为B

永久改变,则仅需新建$HOME/.screenrc即可

1
escape ^Bb

ubuntu制作u盘启动盘: usb-creater-gtk & unetbootin

发表于 2018-05-03 | 分类于 linux | 阅读次数

方法1、Ubuntu使用usb-creator工具制作U盘系统启动盘

1
sudo usb-creator-gtk
阅读全文 »

plus-one

发表于 2018-04-30 | 分类于 algorithm , leetcode | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
https://leetcode.com/problems/plus-one/description/
"""


class Solution(object):
def plusOne(self, digits):
"""
:type digits: List[int]
:rtype: List[int]
>>> s = Solution()
>>> s.plusOne([1, 2, 3])
[1, 2, 4]
>>> s.plusOne([4, 3, 2 ,1])
[4, 3, 2, 2]
>>> s.plusOne([1, 9, 9])
[2, 0, 0]
>>> s.plusOne([9, 9, 9])
[1, 0, 0, 0]
"""
if digits == [0]:
return [1]
idx = len(digits) - 1
while True:
digits[idx] += 1
if digits[idx] != 10:
return digits
else:
digits[idx] = 0
idx -= 1
if idx == -1:
return [1] + digits

valid number

发表于 2018-04-26 | 分类于 algorithm , leetcode | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""
https://leetcode.com/problems/valid-number/description/
"""


class Solution(object):
def isNumber(self, s):
"""
:type s: str
:rtype: bool
"""
try:
float(s.strip())
return True
except Exception:
return False

sqrtx

发表于 2018-04-23 | 分类于 algorithm , leetcode | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
https://leetcode.com/problems/sqrtx/description/
"""


class Solution(object):
def mySqrt(self, x):
"""
:type x: int
:rtype: int
>>> s = Solution()
>>> s.mySqrt(4)
2
>>> s.mySqrt(0)
0
>>> s.mySqrt(8)
2
>>> s.mySqrt(1)
1
>>> s.mySqrt(2147395600)
46340
"""
if 0 <= x < 1:
return 0
elif x == 1:
return 1
else:
# how to choose the init value ?
x0 = x // 2
while True:
# x**2/4 > x
if x0**2 <= x:
return x0
x0 = int((x0 + x / x0) / 2)
1…345…9
ningning

ningning

86 日志
9 分类
GitHub
© 2018 - 2020 ningning
本站访客数 人次