2013年4月10日

Python 加入线程池机制的多线程系统

摘要: 这是根据网上一个例子改良的版本。系统描述:所有线程只执行一个方法func()。func()对应的参数集为args,内部实现参数解释。而每一个线程会对应不同的参数集数据,所以有一个参数集列表list_args且待执行任务总数等于len(list_args)。通过队列Queue进行管理,创建容量为thread_pool_num个线程的线程池同时从任务列表WorkManager.work_queue中提取任务执行。系统由Work和WorkManager两个class构成。Work继承python的threading.Thread,负责实现单一个线程的运作。而WorkManager则负责通过Queue 阅读全文

posted @ 2013-04-10 15:37 0x9801 阅读(268) 评论(0) 推荐(0)

2013年4月7日

表单的动态ChoiceField

摘要: 创建并初始化动态ChoiceFiled的方法:class ViewListForm(forms.Form): UIViewId = forms.ChoiceField() def __init__(self,UIViewList,*args, **kwargs): super(ViewListForm, self).__init__(*args, **kwargs) self.fields['UIViewId'] = forms.ChoiceField(choices=[(UIView["Id"], UIView["Name"]) for 阅读全文

posted @ 2013-04-07 19:01 0x9801 阅读(219) 评论(0) 推荐(0)

2013年4月6日

Win7 启用 Telnet

摘要: 开启后一般会默认为禁用,要到服务启用。设置好后进入cmd > net start telnet 阅读全文

posted @ 2013-04-06 23:29 0x9801 阅读(130) 评论(0) 推荐(0)

httpd.conf配置错误

摘要: 无法启动Apache的原因很有可能是httpd.conf配置错误。如果apache的配置文件httpd.conf搞错了,在windows里启动它,会提示the requested operation has failed,这是比较郁闷的事,因为查错要看个半天。 其实可以用命令行模式启动apache,并带上参数,apache会提示你哪句有误,然后就可以针对性的解决。检查错误方法:进入cmd 然后进入 Apache安装目录(具体为你自己的安装目录)\bin> httpd.exe -w -n "Apache2.2" -k start 阅读全文

posted @ 2013-04-06 23:27 0x9801 阅读(239) 评论(0) 推荐(0)

Apache permission问题

摘要: don't have the permission to access on this server请将Deny from all 修改为Allow from all<Directory /> Options FollowSymLinks AllowOverride all Order deny,allow# Deny from all Allow from all</Directory> 阅读全文

posted @ 2013-04-06 23:26 0x9801 阅读(120) 评论(0) 推荐(0)

iis端口映射的配置方法

摘要: Win 7 环境1. 先在路由器配置页面的『虚拟服务器』位置进行端口映射,添加80-90端口(其实主要是下面会用到的81端口),选择ALL2. 计算机管理>> 服务和应用程序 >> Internet信息服务 >> ...>>Default Web Site找到右侧栏的『绑定』选择『添加』,类型:http,端口:81,ip : *结果如下图。 阅读全文

posted @ 2013-04-06 23:24 0x9801 阅读(2298) 评论(0) 推荐(0)

MySQL密码丢失的处理方法

摘要: 搞了两天终于把MySQL丢失root密码的事情解决掉。补写方法:cmd打开DOS命令行模式,输入net stop mysql 停掉服务;DOS模式下进入mysql的bin目录,输入mysqld --skip-grant-tables,此时程序挂起;cmd打开一个新DOS命令行,输入mysqld -uroot -p,提示输入密码时直接回车(使用空密码登录);顺利的话进入mysql命令行模式,输入下面内容:mysql> use mysql;mysql> UPDATE user SET Password = PASSWORD('TAT') WHERE user =  阅读全文

posted @ 2013-04-06 23:22 0x9801 阅读(147) 评论(0) 推荐(0)

Cg Tessellation: 曲面细分

摘要: struct C3E4_Output { float4 position : POSITION; float4 color : COLOR;};C3E4_Output C3E4v_twist(float2 position : POSITION, float4 color : COLOR, uniform float twisting){ C3E4_Output OUT; float angle = twisting * length(position); float cosLength... 阅读全文

posted @ 2013-04-06 23:17 0x9801 阅读(216) 评论(0) 推荐(0)

Cg MISC

摘要: Color interpolation: performed by the rasterization hardware smoothly shades the interior fragments of the triangle.=========================================struct C3E3f_Output { float4 color : COLOR;};C3E3f_Output C3E3f_texture(float2 texCoord : TEXCOORD0, uniform sampler2D decal){ C3E3f_Output O.. 阅读全文

posted @ 2013-04-06 23:16 0x9801 阅读(153) 评论(0) 推荐(0)

Django Template 设定某值

摘要: {% with name="World" greeting="Hello" %} <html><div>{{ greeting }} {{name}}!</div></html>{% endwith %}注意如果template有其他控制语句,有可能出现嵌套错误,例如:{% with name="D" %} {% for item in inputList %}<p><button type="submit" value="{{name}} 阅读全文

posted @ 2013-04-06 23:09 0x9801 阅读(109) 评论(0) 推荐(0)

导航