随笔分类 -  Web technology

Technologies used to develop webapps.
DOMElement之Offset
摘要:有明确目的的学习比较有效,我学习HTML offset相关概念是出自一个需求,那就是计算一个绝对定位的HTML元素相对于当前窗口的偏移距离,主要是Y方向的偏移,X方向同理。要实现这个目的,首先要弄清楚HTML关于偏移距离的定义:1. offsetTopMDN的定义:TheHTMLElement.of... 阅读全文
posted @ 2015-08-05 16:25 shosciation 阅读(277) 评论(0) 推荐(0)
Nginx+uwsgi+python配置
摘要:版本:Nginx 1.0.5 uwsgi 1.1.2 Python 2.7.2原理:nginx配置 location /python { include uwsgi_params; uwsgi_pass 127.0.0.1:9090;}uwsgi启动参数 uwsgi --socket :9090 --wsgi-file /var/www/project/hello.pyhello.py 文件def application(env, start_response): start_response('200 OK', [('Content-Typ... 阅读全文
posted @ 2012-05-04 18:43 shosciation 阅读(905) 评论(2) 推荐(1)
Http方式下载-Servlet实现
摘要:Http方式下载,Servlet实现与普通的Servlet处理请求类似,浏览器端输入URL,该URL由tomcat分配给相应的Servlet进行处理,以下为示例代码: 1 public void service(HttpServletRequest req, HttpServletResponse res) { 2 3 File file = new File(fileName); 4 if(file.exists()) { 5 FileInputStream in = new FileInputStream(file); 6 try ... 阅读全文
posted @ 2011-09-28 15:05 shosciation 阅读(281) 评论(0) 推荐(0)