- 博客(17)
- 资源 (9)
- 收藏
- 关注
原创 10行代码解释super最常用的情形
class super(object): def __init__(self, cls, instance): mro=instance.__class__.__mro__ self.instance=instance self.next_parent=mro[mro.index(cls)+1] def __getattribute_
2016-04-29 15:26:53 502
原创 N-queens generator implementation in Racket
我发现Racket真是一个很用心的语言. 它有Python里的generator
2014-08-14 11:36:16 571
原创 Python红黑树实现(带树的图形化展示方法)
BLACK = 0RED = 1#graphic elements of rbtree for printingVC = '│'HC = '─'SIZE = 3RIG = '┌' + HC * SIZELEF = '└' + HC * SIZESP = chr(32)IND1 = SP * (SIZE + 1)IND2 = VC + SP * SIZEclass rbno
2014-07-18 14:21:35 3812 3
原创 C# 首个程序
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Text.RegularExpressions;namespace words{ class P
2014-07-15 22:47:56 484
原创 python3 无法读取文本时尝试用二进制方式
import re res=[] with open('words','rb') as f: for line in f: for word in re.split(rb'[^a-zA-Z]',line): if word: res.append(
2014-07-09 18:54:55 1152
原创 C红黑树统计英文单词数量
/* ============================================================================ Name : rbtree.c Author : xiang nan Version : Copyright : 1987-2014 Description : Hello World in
2014-07-09 00:51:48 725
原创 eclipse自定义java模板的详细步骤
1.关键是要知道插入模板的快捷键.Windows-->Preferences-->General-->Keys 找到并设置:Content Assist -->Shift+Ctrl+Space完成第二步后,你在编辑java文件时,键入'heima'然后Shift+Ctrl+Space,就会自动插入模板 了.2.新建某个java模板.Windows
2014-06-27 12:44:08 668
原创 Python 3 函数式编程之列表解析的坑
[f(2) for f in [lambda i:(lambda j:i*j) for i in [1,2,3,4,5]]]
2014-06-07 16:51:12 709
原创 堆排序PYTHON实现
class arr(list): passa=arr([3,5,1,2,9,3,0,7,5,6,3,2])def left(i):return ((i+1)<<1)-1def right(i):return (i+1)<<1def p(i):return (i-1)>>1def heapfy(r,i): t=left(i) s=right(i) if
2014-06-03 15:54:47 529
原创 开放寻址法PYTHON实现
KEYS = (12,6554,12345,34234,234234,6456456,34234,67645,2343432,23423,1343324)DELETED = -1m=len(KEYS)T=[None for _ in range(m)]def h1(k): return kdef h2(k): return 1+(k%(m-1))def h(k,i):
2014-06-02 00:09:45 1290
转载 Python dictionary implementation
http://www.laurentluce.com/posts/python-dictionary-implementation/
2014-05-30 11:43:10 787
原创 C原地快速排序
#include //pt用于打印一个数组void pt(int *r,int ini,int end){ int i; for(i=ini;i<=end;i++){ printf("%d ",r[i]); } printf("\n");}//swap用于交换a和b的值void swap(int *a,int *b){ int
2014-04-30 16:58:34 745 1
原创 插入排序
def sort_insert(arr,reverse=True): print('排序之前的数组%s'%(arr)) size = len(arr) if reverse: cmp = lambda x,y:x>y else: cmp = lambda x,y:x<y def recur(r):
2014-03-27 11:40:18 346
Parsing Techniques - A Practical Guide - 2008
2016-03-02
http/1.1协议2014年最新版
2016-03-01
Nginx official documentation
2016-02-03
how to design programs 2nd edition chm版
2013-11-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人