Skip to content

Instantly share code, notes, and snippets.

#解决Python2.7的UnicodeEncodeError: ‘ascii’ codec can’t encode异常错误
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
@mengdiwang
mengdiwang / cs
Created May 6, 2015 06:41
learning
python http://v.163.com/special/opencourse/bianchengdaolun.html
@mengdiwang
mengdiwang / dateformat.js
Created March 30, 2014 15:17
Date format for javascript
Date.prototype.format = function(format)
{
var o = {
"M+" : this.getMonth()+1, //month
"d+" : this.getDate(), //day
"h+" : this.getHours(), //hour
"m+" : this.getMinutes(), //minute
"s+" : this.getSeconds(), //second
"q+" : Math.floor((this.getMonth()+3)/3), //quarter
"S" : this.getMilliseconds() //millisecond
@mengdiwang
mengdiwang / llvm_build
Created February 26, 2014 03:29
configure and make llvm for cloud9
./configure --enable-optimized --enable-assertions --enable-expensive-checks
CXXFLAGS+="-fexceptions" make -j3