我不明白为什么这两个陈述不相等.
for item in tree.findAll('item'):
names = [{
'id': item.id.string,
'title': __decodefunction(item.entitle.string)
}]
Run Code Online (Sandbox Code Playgroud)
它有1项,但如果这些声明
names = [{
'id': item.id.string,
'title': __decodefunction(item.entitle.string)
}for item in tree.findAll('item')]
Run Code Online (Sandbox Code Playgroud)
它有6个项目.
我想使用第一个循环,但它没有显示正确的项目数.正确的输出是6项.
我尝试sudo service nginx restart并显示此错误:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Run Code Online (Sandbox Code Playgroud)
我认为这是关于这个符号链接?
ln -s ../sites-available/default default
Run Code Online (Sandbox Code Playgroud)
我试试
cd /etc/nginx && grep -R listen *
sites-available/default: listen 80;
sites-enabled/default: listen 80;
Run Code Online (Sandbox Code Playgroud)
我如何解决它?
我试过这个。 /sf/answers/9944861/
喜欢 toolStripStatusLabel1.InvokeRequired
但toolStripStatusLabel1没有InvokeRequired
我也试过这个。 /sf/answers/1108190471/
它像无效参数一样出错
SetTextCallback d = new SetTextCallback(SetText);
form.Invoke(d, new object[] { form, ctrl, text });
当我使用
ThreadHelperClass.SetText(this, toolStripStatusLabel1, "This text was set safely.");
但我使用时不会出错 textBox
我的代码有方法等待bool另一个使用线程在后台运行的方法。
Thread t = new Thread(TestRemoteDB);
t.Start();
// In TestRemoteDB() will call updateRemoteDBStatus()
Run Code Online (Sandbox Code Playgroud)
像这样
private void updateRemoteDBStatus(bool successful)
{
if (successful)
{
toolStripStatusLabel4.Text = "OK!";
toolStripStatusLabel4.ForeColor = Color.Green;
}
else
{
toolStripStatusLabel4.Text = "Error!";
toolStripStatusLabel4.ForeColor = Color.Red;
}
}
Run Code Online (Sandbox Code Playgroud) 我试图用 iptables 来保护 Smurf 攻击。和
iptables -A INPUT -p icmp -m icmp --icmp-type address-mask-request -j DROP
iptables -A INPUT -p icmp -m icmp --icmp-type timestamp-request -j DROP
iptables -A INPUT -p icmp -m icmp -m limit --limit 1/second -j ACCEPT
Run Code Online (Sandbox Code Playgroud)
当我运行这个命令时
iptables -A INPUT -p icmp -m icmp -m limit --limit 1/second -j ACCEPT
Run Code Online (Sandbox Code Playgroud)
iptables 显示并出现错误
iptables v1.4.21: icmp: option "--icmp-type" must be specified
Run Code Online (Sandbox Code Playgroud)
问题是什么 ?