我写了这段代码:
private struct MovePoint
{
public int X;
public int Y;
}
private void Image_MouseDown(object sender, MouseEventArgs e)
{
FirstPoint = new MovePoint();
FirstPoint.X = e.X;
FirstPoint.Y = e.Y;
}
private void Image_MouseMove(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Left)
{
if(FirstPoint.X > e.X)
{
Rectangle.X = FirstPoint.X - e.X;
//Rectangle.Width -= FirstPoint.X - e.X;
} else
{
Rectangle.X = FirstPoint.X + e.X;
//Rectangle.Width += FirstPoint.X + e.X;
}
if(FirstPoint.Y > e.Y)
{
Rectangle.Y = FirstPoint.Y - e.Y;
//Rectangle.Height -= …Run Code Online (Sandbox Code Playgroud) 服务器上有Apache 2 + mod_wsgi + Python 2.6.
我想像PHP脚本一样从Python运行脚本.这个想法可能看起来很愚蠢,但我已经习惯了(至少在开始学习Python时).
例:
PHP - http://example.com/script.php
Python - http://example.com/script.py
PS我知道mod_rewrite和其他类似的技巧可以做到这一点.但它只是一种伪装,而不是直接的运行.
UPD:我的.htaccess文件.index.py工作,但其他python脚本得到404错误.
<Files *.py>
SetHandler wsgi-script
Options ExecCGI FollowSymLinks
</Files>
DirectoryIndex index.py
Run Code Online (Sandbox Code Playgroud) 我正在为CasperJS编写一个脚本.我需要单击包含"1"的跨度的链接.在jQuery中可以使用:contains('1'),但是纯Javascript中的选择器的解决方案是什么?
HTML: <a class="swchItem"><span>1</span></a><a class="swchItem"><span>2</span></a>
jQuery变种: $('a .swchItem span:contains("1")')
UPD CasperJS代码:
casper.then(function () {
this.click('a .swchItem *select span with 1*')
})
Run Code Online (Sandbox Code Playgroud) 寻找简单的php类路由,如下所示:http://fatfree.sourceforge.net/page/routing-engine
有现成的解决方案吗?或者使用整个框架更好(它是轻量级的,甚至可能切断路由器)?
function ChatServerQuery(data_json) {
var result = null;
$.ajax({
url: 'chat/backend/',
type: 'POST',
data: data_json,
success: function(json) {
result = json
}
})
return result
}
Run Code Online (Sandbox Code Playgroud)
我的函数执行对服务器的请求.问题是我无法从服务器文本返回.我不知道如何从匿名函数(事件成功)到ChatServerQuery(您可以轻松地将其取回).
据我了解,状态是归档加密包含通用位标志.我尝试用ZipArchive :: statname()来检查这个,但似乎无法通过此方法获取信息.
我还能做什么?阅读存档并解析标题?我知道我可以调用system(),但我不想使用这种方法,因为它的特殊性(某些托管此函数被禁用).