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
# First, we index a string of length L on the symbols appearing in its prefix of length floor(0.2L+1). Thus, strings of length 5 and 6 are indexed on their first two symbols, while strings of length 4 are indexed on their first symbol only. Thus, the index for a consists of {s1, s2, s4, s8}; the index for b consists of {s1, s3, s5, s6}, the index for c consists of {s2, s3, s5, s7}, and no other symbol is indexed at all. | |
# For s1, we examine the indexes for a and b, which contains all strings but s7. Thus, s1 is compared with 6 other strings. | |
# For s3, we examine the indexes for b and c, which together contain s1, s2, s3, s5, s6, and s7. Thus, s3 is compared with five other strings. | |
# For s6, we examine only the index for b. Thus, s6 is compared only with the three other strings s1, s3, and s5. |
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 requests | |
>>> r = requests.get('http://www.luoo.net/radio/radio2/mp3player.xml') | |
>>> r.status_code | |
200 | |
>>> print r.content | |
锘??xml version="1.0" encoding="UTF-8"?> | |
<player showDisplay="yes" showPlaylist="yes" autoStart="yes"> | |
<song path="http://ftp.luoo.net/radio/radio2/1.mp3" title="鏃呰€? /> | |
<song path="http://ftp.luoo.net/radio/radio2/2.mp3" title="绱㈤潪浜? /> | |
<song path="http://ftp.luoo.net/radio/radio2/3.mp3" title="涓夊嘲" /> |
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
--- complete-dict - Created by Ryan Kulla using Python 2.6 on Ubuntu Linux 9.04 on July 23rd 2009 --- | |
--- Python Keywords (These were manually inputted) --- | |
and | |
del | |
for | |
is | |
raise | |
assert | |
elif |
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
重定向: | |
zsh➜ $ ./file.o | |
before redirect... | |
zsh➜ $ cat demo | |
after redirect... | |
Redirected |
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
下载Wget的源代码,下载地址:http://ftp.gnu.org/gnu/wget/ | |
直接安装的话,会发生下面的错误。 | |
checking for compress in -lz... yes | |
checking for gpg_err_init in -lgpg-error... no | |
checking for gcry_control in -lgcrypt... no | |
checking for libgnutls... no | |
configure: error: --with-ssl was given, but GNUTLS is not available. | |
解决: |
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/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
import sys | |
CITY_RECORD = { | |
# 直辖市 | |
"北京": "101010100", "上海": "101020100", | |
"天津": "101030100", "重庆": "101040100", |
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/env python | |
# -*- coding: utf-8 -*- | |
from bs4 import BeautifulSoup | |
import requests | |
import eyed3 | |
import re | |
import urllib | |
import os |
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/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
from bs4 import BeautifulSoup | |
import re | |
keywords_pattern = re.compile(r".*/([^.]+).mp4*") | |
subtitles_url_pattern = re.compile(r'<option value="en">English</option>') | |
base_url = "http://www.ted.com" |
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/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
import time | |
from bs4 import BeautifulSoup | |
signin_url = "http://www.v2ex.com/signin" | |
award_url = "http://www.v2ex.com/mission/daily" | |
main_url = "http://www.v2ex.com" |
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
➜ YouCompleteMe git:(master) ✗ pwd | |
/Users/xuelang/.vim/bundle/YouCompleteMe | |
➜ YouCompleteMe git:(master) ✗ ls | |
CONTRIBUTING.md README.md cpp install.sh python | |
COPYING.txt autoload doc plugin style_format.sh | |
➜ YouCompleteMe git:(master) ✗ git submodule update --init --recursive |