Skip to content

Instantly share code, notes, and snippets.

View an9er's full-sized avatar

gcj an9er

View GitHub Profile
javascript:function iprl5(){var d=document;z=d.createElement('script');b=d.body;l=d.location;ji_url=window.location.protocol+'//jiji.io/ji?url='+encodeURIComponent(l)+'&title='+d.title;console.log(l.hostname);if(l.hostname=='twitter.com'||l.hostname=='zhihu.com'||l.hostname=='quora.com'||l.hostname=='github.com'){window.open(ji_url);}else{try{if(!b)throw(0);if(!l){alert('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%BD%91%E5%9D%80%EF%BC%81');return;}d.title='(%E9%9B%86%E9%9B%86ing...) '+d.title;z.setAttribute('src',ji_url);b.appendChild(z);}catch(e){alert('%E8%AF%B7%E7%AD%89%E5%BE%85%E7%BD%91%E9%A1%B5%E5%8A%A0%E8%BD%BD%E5%AE%8C%E6%AF%95%EF%BC%81');}}}iprl5();void(0)
javascript:function iprl5(){var d=document;z=d.createElement('script');b=d.body;l=d.location;ji_url=window.location.protocol+'//jiji.io/ji?url='+encodeURIComponent(l);console.log(l.hostname);if(l.hostname=='twitter.com'||l.hostname=='zhihu.com'||l.hostname=='quora.com'||l.hostname=='github.com'){window.open(ji_url);}else{try{if(!b)throw(0);if(!l){alert('%E8%A
##### =======
--prefix=/usr \
--localstatedir=/var \
--libexecdir=${prefix}/lib/squid3 \
--datadir=${prefix}/share/squid3 \
--sysconfdir=/etc/squid3 \
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
# -*- coding: utf-8 -*-
import time
def timestamp_datetime(value):
format = '%Y-%m-%d %H:%M:%S'
# value为传入的值为时间戳(整形),如:1332888820
value = time.localtime(value)
## 经过localtime转换后变成
## time.struct_time(tm_year=2012, tm_mon=3, tm_mday=28, tm_hour=6, tm_min=53, tm_sec=40, tm_wday=2, tm_yday=88, tm_isdst=0)
@an9er
an9er / question.txt
Last active December 10, 2015 07:48
[QUESTION] Reloading submodules in IPython
[ANSWER]
IPython comes with some automatic reloading magic:
%load_ext autoreload
%autoreload 2
It will reload all changed modules every time before executing a new line. The way this works is slightly different than dreload. Some caveats apply, type %autoreload? to see what can go wrong.
@an9er
an9er / met.py
Created December 10, 2015 03:06
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Breif Module Description: show the number of published news every day
# Created on Wednesday, 11 November 2015.
import datetime
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import sys
import time
i = 0
while 1:
print "\rwait", "."*i,
sys.stdout.flush()
time.sleep(3)
i += 1
@an9er
an9er / 0916.md
Created September 15, 2015 16:27

key word:

  • 有效输入

http://bbs.tianya.cn/post-english-121795-1.shtml 天涯-告诉你外语学习的...

学英文是学习新技能的一个大类,学python也是学习一个新技能,根据这两个可以总结出学习新技能的一些共同点。 具体做法是要思考:

  • python学的怎么样
    • 够用,能够实现自己的program想法
  • 学python中有一种新的学习体验
    • 主动的去学习,因为会想到学了之后工作上会用到,能提高工作代码质量
  • ps:这与精进有什么联系

一些政策:

  • 美国政府发现大部分移民5年以上英文还很差,于是试图通过修改移民政策鼓励学英文。政府提出:如果拿到绿卡后,4年就可以把英文说流利,通过考试,第4年就给公民权。但美国的语言专家们纷纷起来反对,骂政府愚蠢。大部分人明明5年都学不会,奖励其中英语好的也不能让其他人学会呀?他们说:好比大家都是饥民,你应该想办法给大家吃饱,而不是奖励其中最胖的人呀?这一职责登在了2005年《今日美国》上,后来这一政策没有实行。
  • 还有之前知乎上有人说过军人结婚的问题。那个人觉得这个政策也是有问题的,理由是要想弥补军人就应该每年发补贴,让女孩都喜欢嫁给军人。而不是通过硬性规定让军人的择偶对象以后不可移离婚。还有孕妇在公司不能被辞职。同样的性质。国家在这里舍不得钱于是只能制定出这样的政策来。