This file contains hidden or 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
from multiprocessing import Pool,Process | |
def f(x): | |
return x*x | |
def f2(x): | |
return [i*i for i in x] | |
num = 10000000 |
This file contains hidden or 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
''' | |
http://en.wikipedia.org/wiki/Base_36#Python%5FConversion%5FCode | |
''' | |
def base36encode(number): | |
if not isinstance(number, (int, long)): | |
raise TypeError('number must be an integer') | |
if number < 0: | |
raise ValueError('number must be positive') | |
alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
This file contains hidden or 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
Opera Preferences version 2.1 | |
; Do not edit this file while Opera is running | |
; This file is stored in UTF-8 encoding | |
[matches] | |
; One can disable xft or core fonts if necessary | |
;engine:xft=blacklist | |
engine:x11=blacklist |
This file contains hidden or 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
from scrapy import log | |
from scrapy.contrib.spiders import CrawlSpider, Rule | |
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor | |
from scrapy.xpath.selector import HtmlXPathSelector | |
from scrapy.item import ScrapedItem | |
def safecn(i): | |
try: | |
return unichr(int(i)) | |
except: |
This file contains hidden or 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
s = u'如何面对产痛 ' | |
print "".join( map(lambda x:unichr(int(x.replace("&#",""))),filter(lambda x:x!='',s.strip().split(";"))) ) |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Test CSS Ani</title> | |
<style type="text/css" media="screen"> | |
body { margin: 0; color: #fff; background: #000; overflow: hidden; } | |
#header h1, #apple div.icon { color: transparent; } | |
#apple, #header, #safari { position: absolute; top: 40%; left: 50%; } | |
#apple { width: 600px; height: 538px; margin: -290px 0 0 -290px; overflow: hidden; } | |
#apple div { position: absolute; width: 600px; height: 538px; opacity: 0; filter: alpha(opacity=0); } |
This file contains hidden or 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
*** Makefile Tue May 26 16:10:20 2009 | |
--- Makefile.bak Tue May 26 11:07:05 2009 | |
*************** | |
*** 14,31 **** | |
MAINTAINER= [email protected] | |
COMMENT= Network interface of Tokyo Cabinet | |
! BUILD_DEPENDS= tokyocabinet>=1.4.20:${PORTSDIR}/databases/tokyocabinet | |
LIB_DEPENDS= tokyocabinet:${PORTSDIR}/databases/tokyocabinet | |
! RUN_DEPENDS= tokyocabinet>=1.4.20:${PORTSDIR}/databases/tokyocabinet |
This file contains hidden or 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
# | |
# controller.py | |
# sha1_pyobjc | |
# | |
# Created by yanxu on 09/05/18. | |
# Copyright (c) 2009 SINA. All rights reserved. | |
# | |
from objc import YES, NO, IBAction, IBOutlet | |
from Foundation import * |
This file contains hidden or 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
hardstatus on | |
hardstatus alwayslastline | |
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a " |
This file contains hidden or 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
# encoding: utf-8 | |
import random | |
from pinyin import hanzi2pinyin | |
def addpinyin(text): | |
textcount=len(text) | |
replace_dict={} | |
pinyincount=5#最小添加拼音的字数,5个字 | |
for i in range(pinyincount): | |
s = random.choice(text)#要替换的文字 |