摘要:
import re import requests text=requests.get("https://movie.douban.com").text #1.匹配漢字 \u4E00-\u9FA5 re.findall('[ \u4E00-\u9FA5]+',text) #參考 https://ww
閱讀全文
摘要:
經典遞歸例子匯總與點評: 2
1. N!,求N的階乘 2
2. 1+2+3+.....+n,求前N項和 2
3. Fibonacci數列,F(n)=F(n-1)+F(n-2) 2
4. GCD(a,b),求最大公約數 3
5. Hanoi塔,從A移到C 3
6. 回文數判定 4
7. 楊輝三角 4
8. 快速排序,二路歸并 5
1. 快速排序 5
2. 二路歸并 6
9. Bs Tree(二叉樹的前,中,后序遍歷) 6
10. 全排列 9
11. 8 Queen problem 10
12. 約瑟夫環問題 11
閱讀全文
摘要:
輸入: 每行輸入1個正整數n,(0<n<1000 000) 輸出: 對于每個n,輸出n!的(十進制)位數 digit, 和最高位數firstNum。(n!約等于 firstNum * 10^[digit-1] ) 方法一: 利用數學庫及相關知識。 采用蠻力,根據定義,直接求解! 所謂n!的十進制位數
閱讀全文
摘要:
http://www.ccdream.com/s/hacker/54.html
閱讀全文
摘要:
Ctrl+a跳到第一個字符前Ctrl+x同上但再按一次會從新回到原位置Details see below:Linux shell shortcut
閱讀全文
摘要:
轉腳本如: nohup /mnt/Nand3/H2000G >/dev/null 2>&1 & 對于& 1 更準確的說應該是文件描述符 1,而1一般代表的就是STDOUT_FILENO,實際上這個操作就是一個dup2(2)調用.他標準輸出到all_result,然后復制標準輸出到文件描述符2(STDERR_FILENO),其后果就是文件描述符1和2指向同一個文件表項,也可以說錯誤的輸出被合并了.其中0表示鍵盤輸入 1表示屏幕輸出2表示錯誤輸出.把標準出錯重定向到標準輸出,然后扔到/DEV/NULL下面去。通俗的說,就是把所有標準輸出和標準出錯都扔到垃圾桶里面
閱讀全文
摘要:
If you want to disable the screen switching, and you don't want tochange your termcap, you can add these lines to your .vimrc: > :set t_ti= t_te=The default of my terminal tool XShell is screen switching, after editing from vim.If you want to enable it, pls refer to vim help screen:)
閱讀全文
摘要:
參考:http://blog.chinaunix.net/uid-20788517-id-3135826.html
閱讀全文
摘要:
Tips for VNCServerAfter the ClearCase server reboot by Jingwei, my vncserver background process is also being shutdown. then I use vncservercmd to create a new connection to wait VNCView connect again. but always report the following log:xauth: error in locking authority file /home/xr/wangliang1/.Xa
閱讀全文