自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 资源 (3)
  • 收藏
  • 关注

原创 code fragment Six from

>>> data = {}>>> data.get(cat, 1)1>>> data{}>>> data.setdefault(cat, 1)1>>> data{cat: 1}>>> data.setdefault(dog, []).append(2)>>> data{dog: [2], cat: 1}>>> data[bear] = 1 + data.get(b

2007-08-25 23:08:00 491

原创 code fragment Five from

"""Using dict to implement dispatch"""animals = []number_of_felines = 0def deal_with_a_cat():    global number_of_felines    print "meow"    animals.append(feline)    number_of_felines += 1def dea

2007-08-25 22:39:00 547

原创 code fragment Four from

"""Given two dicts, find the set of keys that are in both dicts"""import timedef timeo(fun, n=1000):    def void(  ): pass    start = time.clock(  )    for i in range(n): void(  )    stend = time.cl

2007-08-25 22:33:00 467

原创 code fragment Three from

"""unzip simple list-like obj"""def unzip(p, n):    """ Example:        >>> unzip([a,b,c,d,e], 3)        [(a, d), (b, e), (c, None)]    """    mlen, lft = divmod(len(p), n)    if

2007-08-25 22:29:00 472

原创 code fragment Two from

"""List Comprehensions instead of map and filter"""theoldlist = range(10)thenewlist = map(lambda x: x+23, theoldlist)thenewlist2 = [x+23 for x in theoldlist]print thenewlist == thenewlist2thenewlist

2007-08-25 22:19:00 487

原创 code fragment One from

##########################################################"""Flattening a Nested Sequence"""from __future__ import generatorsdef flatten(sequence, scalarp, result=None):    if result is None: result

2007-08-25 22:07:00 481

原创 ubuntu7.04下安装Apache2

 总是提示错误:正在设置 apache (1.3.34-2ubuntu0.1) ...dpkg:处理 apache (--configure)时出错: 子进程·post-installation script·返回了错误号·10在处理时有错误发生: apacheE: Sub-process /usr/bin/dpkg returned an error code (1)百度了一下,没什么头绪,看到

2007-08-12 11:04:00 580

中文停用词表

中文处理中可能会用的停用词表,用来过滤掉无用信息。我综合处理了多个中文停用词表,希望能对大家有用。

2008-05-13

C4.5R8

C4.5 decision tree 算法实现

2008-04-26

Inside C++ Object Model

Inside C++ Object Model, chm 格式电子书

2007-05-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除