# apt-get install g++
2014年9月17日 星期三
x86_64-linux-gnu-gcc: error trying to exec 'cc1plus': execvp: No such file or directory
2014年9月15日 星期一
Python json.dumps 時含有時間物件
TypeError: datetime.datetime(2014, 9, 16, 10, 24, 26, 755110) is not JSON serializable
References :
python - Cannot serialize datetime as JSON from Cherrypy - Stack Overflow
class DateEncoder(json.JSONEncoder): def default(self, obj): if hasattr(obj, 'isoformat'): return obj.isoformat() else: return str(obj) return json.JSONEncoder.default(self, obj) json.dumps(my_variable, cls=DateEncoder)
References :
python - Cannot serialize datetime as JSON from Cherrypy - Stack Overflow
2014年9月13日 星期六
2014年9月9日 星期二
2014年9月7日 星期日
Access Flask config variable in Jinja
{{ config['MY_CONFIGURATION'] }}
or
{{ config.MY_CONFIGURATION }}
References :
python - Flask - Accessing the config variable in the template - Stack Overflow
2014年9月6日 星期六
reinstall debian package with config files
$ cd /var/cache/apt/archives
# dpkg --install --force-confmiss mysql-server-5.5_5.5.38-0ubuntu0.14.04.1_amd64.deb
References :
Linux Wisdom: Reinstall deleted or damaged files in Debian/Ubuntu
2014年9月5日 星期五
git pull remote branch
$ git checkout -b < new_branch > origin/< new_branch >
fatal: git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout ‘origin/‘ which can not be resolved as commit?’
$ git pull
References :
Wetware » Pull A Git Branch from Remote
訂閱:
文章 (Atom)