我正在阅读scrapy教程http://doc.scrapy.org/en/latest/intro/tutorial.html ,我一直跟着它直到我运行这个命令
scrapy crawl dmoz
Run Code Online (Sandbox Code Playgroud)
它给了我输出错误
2013-08-25 13:11:42-0700 [scrapy] INFO: Scrapy 0.18.0 started (bot: tutorial)
2013-08-25 13:11:42-0700 [scrapy] DEBUG: Optional features available: ssl, http11
2013-08-25 13:11:42-0700 [scrapy] DEBUG: Overridden settings: {'NEWSPIDER_MODULE': 'tutorial.spiders', 'SPIDER_MODULES': ['tutorial.spiders'], 'BOT_NAME': 'tutorial'}
2013-08-25 13:11:42-0700 [scrapy] DEBUG: Enabled extensions: LogStats, TelnetConsole, CloseSpider, WebService, CoreStats, SpiderState
Traceback (most recent call last):
File "/usr/local/bin/scrapy", line 4, in <module>
execute()
File "/Library/Python/2.7/site-packages/scrapy/cmdline.py", line 143, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/Library/Python/2.7/site-packages/scrapy/cmdline.py", line 88, in _run_print_help
func(*a, **kw) …Run Code Online (Sandbox Code Playgroud) 我正在使用logstash jdbc来保持mysql和elasticsearch之间的同步.它适用于一张桌子.但是现在我想为多个表做这件事.我需要在终端中打开多个
logstash agent -f /Users/logstash/logstash-jdbc.conf
Run Code Online (Sandbox Code Playgroud)
每个都有一个选择查询或我们有更好的方法这样做,所以我们可以有多个表更新.
我的配置文件
input {
jdbc {
jdbc_driver_library => "/Users/logstash/mysql-connector-java-5.1.39-bin.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://localhost:3306/database_name"
jdbc_user => "root"
jdbc_password => "password"
schedule => "* * * * *"
statement => "select * from table1"
}
}
output {
elasticsearch {
index => "testdb"
document_type => "table1"
document_id => "%{table_id}"
hosts => "localhost:9200"
}
}
Run Code Online (Sandbox Code Playgroud)
我需要在我的应用程序中只使用2个选项卡.所以我希望它们覆盖100%的宽度.目前它对齐左侧的两个表格,并在右侧留下所有类型的空白区域.我能做什么才能让我的两个标签覆盖100%的区域.我正在使用jquery-ui-1.8.17.custom.css
码
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.8.17.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript">
$(function(){
// Tabs
$('#tabs').tabs();
});
</script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>My Title</h1>
</div><!-- /header -->
<div data-role="content">
<div id="tabs">
<ul>
<li><a href="#tabs-1">First</a></li>
<li><a href="#tabs-2">Second</a></li>
</ul>
<div id="tabs-1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim …Run Code Online (Sandbox Code Playgroud) 我怎样才能在php中找到下一个最接近的小时
例如,如果当前时间是4:15,那么下一个小时将是5,等等
$dateString = 'Tue, 13 Mar 2012 04:48:34 -0400';
$date = new DateTime( $dateString );
echo $date->format( 'H:i:s' );
Run Code Online (Sandbox Code Playgroud)
从字符串给我时间,我想扩展它并获得下一个最接近的小时
我有一个逗号分隔值的字符串.如何计算以逗号分隔的字符串中的元素数量.例如,跟随字符串有4个元素
string ="1,2,3,4";
我正在使用下面的代码.我想要做的是在展开或折叠视图上有+或-符号.我怎样才能做到这一点?这是代码:
<!--//---------------------------------+
// Developed by Roshan Bhattarai |
// http://roshanbh.com.np |
// Fell Free to use this script |
//---------------------------------+-->
<title>Collapsible Message Panels</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//hide the all of the element with class msg_body
$(".msg_body").show();
//toggle the componenet with class msg_body
$(".msg_head").click(function(){
$(this).next(".msg_body").slideToggle(100);
});
});
</script>
<style type="text/css">
body {
margin: 10px auto;
width: 570px;
font: 75%/120% Verdana,Arial, Helvetica, sans-serif;
}
p {
padding: 0 0 1em;
}
.msg_list {
margin: 0px; …Run Code Online (Sandbox Code Playgroud) pg.myfunc = function(){
var i = 1, j = 2;
this.selected = 1;
xx.newObject = this.parentElement;
...
Run Code Online (Sandbox Code Playgroud)
在xx.newObject = this.parentElement;做什么?
我在一个函数中有多个数组,我想在另一个函数中使用.如何将它们返回到另一个函数中使用
this.runThisFunctionOnCall = function(){
array1;
array2;
array3;
return ????
}
Run Code Online (Sandbox Code Playgroud) 我有以下代码,我将通过表列,如果它是最后一列,我希望它做一些不同的事情.现在它的硬编码,但我怎么能改变所以它自动知道它的最后一列
$(this).find('td').each(function (i) {
if(i > 0) //this one is fine..first column
{
if(i < 4) // hard coded..I want this to change
{
storageVAR += $(this).find('.'+classTD).val()+',';
}
else
{
storageVAR += $(this).find('.'+classTD).val();
}
}
});
Run Code Online (Sandbox Code Playgroud) 我有这个
$number = 0.5
if (is_float($number))
{
echo 'float';
}
else
{
echo 'not float';
}
Run Code Online (Sandbox Code Playgroud)
并且它不会浮动.可能是什么原因,谢谢