测试的dota水平...目的是学习一下tornado框架

#coding:utf8
import tornado.web,tornado.httpserver,tornado.ioloop,tornado.options
from tornado.web import Application
import pymongo,os from test import test class MyHandler(tornado.web.RequestHandler):
def get(self):
self.render("index.html")
def post(self):
score=self.get_argument("score")
a,b,c=test(score) self.render("score.html",jianding=a,yingxiong=b,result=c) settings={
"template_path":"/root/template",
"debug":True,
"static_path":os.path.dirname(__file__)+"/static",
} if __name__ == "__main__":
http_server = tornado.httpserver.HTTPServer(Application(handlers=[('/',MyHandler)],**settings ))
http_server.listen(8000)
tornado.ioloop.IOLoop.instance().start()

下面是templates:

<html>
<head>
<meta charset='utf8'>
<title>你的天梯分数</title>
</head>
<body>
<form action="." method="post">
<h1>输入你的11 id,..</h1>
<input type='text' name='score' />
<input type="submit">
</from>
</body>
</html> <!--
下面是查询后的页面..
--> <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css"> </style> </style>
</head>
<body >
<h1>..</h1>
{%autoescape None%}
{{jianding}} <hr/> {{yingxiong}} <hr/>
{{result}} <canvas id="c"></canvas>
<script>
var b = document.body;
var c = document.getElementsByTagName('canvas')[0];
var a = c.getContext('2d');
document.body.clientWidth; with(m=Math)C=cos,S=sin,P=pow,R=random;c.width=c.height=f=500;h=-250;function p(a,b,c){if(c>60)return[S(a*7)*(13+5/(.2+P(b*4,4)))-S(b)*50,b*f+50,625+C(a*7)*(13+5/(.2+P(b*4,4)))+b*400,a*1-b/2,a];
A=a*2-1;B=b*2-1;if(A*A+B*B<1){if(c>37){n=(j=c&1)?6:4;o=.5/(a+.01)+C(b*125)*3-a*300;w=b*h;return[o*C(n)+w*S(n)+j*610-390,o*S(n)-w*C(n)+550-j*350,1180+C(B+A)*99-j*300,.4-a*.1+P(1-B*B,-h*6)*.15-a*b*.4+C(a+b)/5+P(C((o*(a+1)+(B>0?w:-w))/25),30)*.1*(1-B*B),o/1e3+.7-o*w*3e-6]}if(c>32){c=c*1.16-.15;o=a*45-20;w=b*b*h;z=o*S(c)+w*C(c)+620;return[o*C(c)-w*S(c),28+C(B*.5)*99-b*b*b*60-z/2-h,z,(b*b*.3+P((1-(A*A)),7)*.15+.3)*b,b*.7]}o=A*(2-b)*(80-c*2);w=99-C(A)*120-C(b)*(-h-c*4.9)+C(P(1-b,7))*50+c*2;z=o*S(c)+w*C(c)+700;return[o*C(c)-w*S(c),B*99-C(P(b, 7))*50-c/3-z/1.35+450,z,(1-b/1.2)*.9+a*.1, P((1-b),20)/4+.05]}}
setInterval('for(i=0;i<1e4;i++)if(s=p(R(),R(),i%46/.74)){z=s[2];x=~~(s[0]*f/z-h);y=~~(s[1]*f/z-h);if(!m[q=y*f+x]|m[q]>z)m[q]=z,a.fillStyle="rgb("+~(s[3]*h)+","+~(s[4]*h)+","+~(s[3]*s[3]*-80)+")",a.fillRect(x,y,1,1)}',0)
</script> <script> </script>
</body>
</html>

dota 路人水平鉴定器的更多相关文章

  1. android中常用的布局管理器(二)

    接上篇博客 (3)LinearLayout     线性布局管理器 线性布局管理器是将放入其中的组件按照垂直或水平方向来布局,每一行或每一列只能放一个组件,并且不会换行,当组件排列到窗体的边缘后,后面 ...

  2. 编写高质量代码:改善Java程序的151个建议(第7章:泛型和反射___建议106~109)

    建议106:动态代理可以使代理模式更加灵活 Java的反射框架提供了动态代理(Dynamic Proxy)机制,允许在运行期对目标类生成代理,避免重复开发.我们知道一个静态代理是通过主题角色(Prox ...

  3. QT学习第2天

    回顾: 1.构建一个QT工程步骤 (1)qmake -project (2)qmake (3)make   2.两个常用的组件 QLabel 标签 QPushButton 按钮   --------- ...

  4. linux端口详解

    Linux端口总结如下: 0|无效端口,通常用于分析操作系统 1|传输控制协议端口服务多路开关选择器 2|管理实用程序 3|压缩进程 5|远程作业登录 7|回显 9|丢弃 11|在线用户 13|时间 ...

  5. GTK+中的构件II(Widgets)

    GTK+中的构件II(Widgets) GTK+中的构件II(Widgets) 在本章的GTK+程序设计中,我们仍然要继续向大家介绍和展示各种各样的构件. GtkComboBox GtkComboBo ...

  6. Qt4.7文档翻译:Qt样式单参考,Qt Style Sheets Reference(超长,超全)

    内容目录 Qt样式单参考 可进行样式设置的部件列表 属性列表 图标列表 属性类型列表 伪状态列表 子控件列表 Qt样式单参考 Qt样式单支持各种属性.伪状态和子控件,这样使得妳能够自行设计部件的外观. ...

  7. QT第二天学习

    回顾: qmake: qmake -project //生成*.pro文件 qmake //makefile make 注:if(qmake -v  >=5) then QT += widget ...

  8. [Python] wxPython 编辑框组件学习总结 (原创)

    1.总结 1.常用4种 编辑框 的构造 1.普通编辑框 单行输入的简单编辑框 (?为所在框的对象,同下) self.textBox = wx.TextCtrl(parent = ?) 2.密码编辑框 ...

  9. kali linux学习笔记(四) : 网络端口大全介绍

    端口大全介绍 2端口:管理实用程序 3端口:压缩进程 5端口:远程作业登录 7端口:回显 9端口:丢弃 11端口:在线用户 13端口:时间 17端口:每日引用 18端口:消息发送协议 19端口:字符发 ...

随机推荐

  1. 【shell】while read line 与for循环的区别

    http://m.blog.itpub.net/22664653/viewspace-1175858/

  2. 解决content is not allowed in prolog问题

    将xml文档用notepad++以UTF-8无BOM格式编码保存便可以了

  3. Git链接到自己的Github(1)简单的开始

    好长时间没上来弄东西了,今天回来先开始弄下Git,之后再继续写uboot与kernel的编译,在版本控制下更加宏观地观察每次的变化. 1.在ubuntu中安装git $ sudo apt-get in ...

  4. 用C# sqlserver实现增删改查

    using System.Data;using System.Data.SqlClient;//先打开两个类库文件SqlConnection con = new SqlConnection(); // ...

  5. C#_delegate - Pair<T> 静态绑定

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  6. Understanding the Router

    Understanding the Router Our module is coming along nicely. However, we're not really doing all that ...

  7. svn :Can't connect to host *.*.*.*': 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

    Can't connect to host *.*.*.*': 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败. -------------------------------- ...

  8. java.lang.NoSuchFieldError: RAW_XML_FILE_HEADER,调用XWPFTemplate动态合并生成一个新的docx文档时报错

    在使用 org.apache.poi 对office文件  根据表单内容和已上次的附件 动态合并成一个新的文档时,本地调试完全ok 但是发布倒Linux环境上就老是报这个错误java.lang.NoS ...

  9. MySQL(17):Select-union(联合查询)使用注意事项

    1. 需求: 获得0115班所有的代课教师代课天数,结果按照升序排序:同时获得0228班,结果按照降序排序. (1)首先查询原来的0115班和0228班所有代课天数,如下:       (2)使用un ...

  10. Android(java)学习笔记137:Android中SimpleAdapter,ArrayAdapter和BaseAdapter常见的适配器

    1.SimpleAdapter(BaseAdapter子类扩展类): simpleAdapter的扩展性最好,可以定义各种各样的布局出来,可以放上ImageView(图片)等.可以显示比较复杂的列表, ...