Skip to content

Instantly share code, notes, and snippets.

@lepture
lepture / china-dream.md
Last active October 8, 2015 18:48
龍應台:我們的「中國夢」(8月1日北京大學演講講辭)

龍應台:我們的「中國夢」(8月1日北京大學演講講辭)

【明報專訊】第一次接到電話,希望我談談「中國夢」的時候,我的第一個反應是:「一千枚飛彈對準我家,我哪裏還有中國夢啊?」

可是沉靜下來思索,1952年生在台灣的我,還有我前後幾代人,還真的是在「中國夢」裏長大的,我的第一個中國夢是什麼呢?

我們上幼稚園時,就已經穿著軍人的制服、帶著木製的步槍去殺「共匪」了,口裏唱著歌。當年所有的孩子都會唱的那首歌,叫做《反攻大陸去》:

反攻 反攻 反攻大陸去

@onlytiancai
onlytiancai / wawammseg.py
Created June 30, 2012 08:44
写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码
# -*- coding:utf-8 -*-
'写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码'
'搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5'
import string
__dict = {}
def load_dict(dict_file='words.dic'):
'加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典'
@scturtle
scturtle / txt2epub.py
Created September 10, 2011 07:17
txt to epub
# coding: utf-8
import os
#书籍信息
title='test book'
creator='scturtle'
description='blablablabla'
#章节文件
txtlist=['1.txt','2.txt']
@lepture
lepture / xiami.py
Created June 8, 2011 12:35
xiami checkin script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011, lepture.com
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
@qingfeng
qingfeng / models.py
Created May 16, 2010 14:23
Django Image Field UnitTest
from django.db import models
class M1(models.Model):
title = models.CharField(max_length=100)
img1 = models.ImageField(upload_to="static/")
def __unicode__(self):
return self.title