>>> list(itertools.combinations(range(1, 5), 2))
[(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)]
2014年5月16日 星期五
Python 列出所有組合
2014年5月14日 星期三
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
if(event.preventDefault)
{
event.preventDefault();
}
else
{
event.returnValue = false;
}
2014年5月13日 星期二
Javascript fix barcode reader send ENTER+CRTL+J
add some code in line 37
References :
Disable ctrl + n and other ctrl + key combinations in JavaScript
if(event.preventDefault)
{
event.preventDefault();
}
else
{
event.returnValue = false;
}
References :
Disable ctrl + n and other ctrl + key combinations in JavaScript
2014年5月12日 星期一
Flask get all routing rules
for rule in app.url_map.iter_rules(): options = {} for arg in rule.arguments: options[arg] = "[{0}]".format(arg) methods = ','.join(rule.methods) url = url_for(rule.endpoint, **options)print rule.endpointprint methodsprint url
References :
python - get a list of all routes defined in the app - Stack Overflow
flask url path param
request.path /page.htmlrequest.script_root /myapplicationrequest.base_url http://www.example.com/myapplication/page.htmlrequest.url http://www.example.com/myapplication/page.html?x=yrequest.url_root http://www.example.com/myapplication/
request.referrer
request.args GET params
References :
python - Flask request fields to get url path - Stack Overflow
2014年5月8日 星期四
Internet Explorer prevent jQuery Ajax cache
$.ajax({ cache: false, //other options... });
References :
How to prevent a jQuery Ajax request from caching in Internet Explorer? - Stack Overflow
訂閱:
文章 (Atom)