小编luk*_*ewm的帖子

使用jQuery中止Ajax请求

使用jQuery,如何取消/中止我尚未收到响应的Ajax请求

javascript ajax jquery

1775
推荐指数
17
解决办法
57万
查看次数

CSS:包含div的自动高度,包含div的背景div上的100%高度

问题是,我有一个内容div,它在容器高度上伸展它的容器(容器和内容div有自动高度).

我想要背景容器,它是内容div的兄弟div来拉伸以填充容器.后台容器包含div以将背景分成块.

背景和容器div的宽度为100%,内容容器没有.

HTML:

<div id="container">  
    <div id="content">  
        Some long content here ..  
    </div>  
     <div id="backgroundContainer">  
         <div id="someDivToShowABackground"/>  
         <div id="someDivToShowAnotherBackground"/>  
    </div>  
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

#container {
    height:auto;
    width:100%;
}

#content {
    height: auto;
    width:500px;
    margin-left:auto;
    margin-right:auto;
}

#backgroundContainer {
    height:100%;??? I want this to be the same height as container, but 100% makes it the height of the viewport.
}
Run Code Online (Sandbox Code Playgroud)

css height

35
推荐指数
4
解决办法
17万
查看次数

当我有几个针对该目标的配置时,如何在Maven插件中使用特定配置运行特定目标

请参阅下面的pom.xml中的插件配置.

我可以:

mvn myplugin:myGoal

哪个运行myGoal(我认为都是执行)但我希望能够独立选择第一个或第二个执行.

我知道我可以在执行元素中添加一个id,但是如何在命令行中引用该id.我想得到一些能够完成这个想象命令的功能:

mvn myplugin:myGoal --executionId=1

这是可能的,还是我以错误的方式解决这个问题?

        <plugin>
            <groupId>org.myplugin</groupId>
            <artifactId>myplugin-maven-plugin</artifactId>
            <version>1.1.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>myGoal</goal>
                    </goals>
                    <configuration>
                        <myParam>cats</myParam>
                    </configuration>
                </execution>
                <execution>
                    <goals>
                        <goal>myGoal</goal>
                    </goals>
                    <configuration>
                        <myParam>dogs</myParam>
                    </configuration>
                </execution>
            </executions>
        </plugin>
Run Code Online (Sandbox Code Playgroud)

plugins maven-2 pom.xml maven

27
推荐指数
3
解决办法
6万
查看次数

启用数据捕获时,在DB2中使列可为空

我正在使用db2版本9.7*,似乎不可能以任何直接的方式使NOT NULL列可以为空.

不幸的是,使用更加开发人员友好的数据库的解决方案不可用.基本上,在MySQL中,我想做类似的事情(其中MY_COLUMN曾经是VARCHAR(200)NOT NULL):

ALTER TABLE MY_TABLE MODIFY COLUMN MY_COLUMN VARCHAR(200);
Run Code Online (Sandbox Code Playgroud)

db2 nullable alter non-nullable notnull

19
推荐指数
3
解决办法
6万
查看次数

在jboss上的Yui压缩器StringIndexOutOfBoundsException

当用2.4.6最小化yui时,我遇到了这个问题:

java.lang.StringIndexOutOfBoundsException:字符串索引超出范围:232

at java.lang.String.substring(String.java:1934)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceString(JavaScriptCompressor.java:267)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:330)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
Run Code Online (Sandbox Code Playgroud)

它通过我的IDE启动时工作,但当部署到jboss时它没有.这个地方:http://yuilibrary.com/forum/viewtopic.php?p = 200686对同一个问题进行了一些讨论.

显然问题是org/mozilla/javascript/Parser在我的maven配置中拉入的两个罐子里面:

<dependency>
<groupId>com.yahoo.platform.yui</groupId>
<artifactId>yuicompressor</artifactId>
<version>2.4.6</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

有什么方法可以使用maven排除等或通过升级我的YUI版本来解决这个问题.它似乎很无聊,它只是不起作用,我不想写一个自定义类加载器.

请帮忙!

javascript java jboss yui tapestry

11
推荐指数
2
解决办法
4354
查看次数

Elasticsearch提高了查询性能

我正在尝试提高查询性能.对于甚至没有触及嵌套文档的简单查询,平均需要大约3秒,并且有时更长.

curl "http://searchbox:9200/global/user/_search?n=0&sort=influence:asc&q=user.name:Bill%20Smith"
Run Code Online (Sandbox Code Playgroud)

即使没有那种,也需要几秒钟.以下是群集的详细信息:

1.4TB index size.
210m documents that aren't nested (About 10kb each)
500m documents in total. (nested documents are small: 2-5 fields).
About 128 segments per node.
3 nodes, m2.4xlarge (-Xmx set to 40g, machine memory is 60g)
3 shards.
Index is on amazon EBS volumes.
Replication 0 (have tried replication 2 with only little improvement)
Run Code Online (Sandbox Code Playgroud)

我没有看到任何明显的CPU /内存等峰值.任何想法如何改进?

java lucene elasticsearch

4
推荐指数
1
解决办法
7317
查看次数

Elasticsearch by id不起作用,但文档存在

我看到有关弹性搜索1.2.0(最近从1.0.1升级)的ID的奇怪行为.

搜索检索我的文档,显示_id的正确值:

[终奌站]

curl 'myServer:9200/global/_search?q=someField:something
Run Code Online (Sandbox Code Playgroud)

结果是

{
  "took": 79,
  "timed_out": false,
  "_shards": {
    "total": 12,
    "successful": 12,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 17.715034,
    "hits": [
      {
        "_index": "global",
        "_type": "user",
        "_id": "7a113e4f-44de-3b2b-a3f1-fb881da1b00a",
        ...
      }
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

但直接查找id不会:
[terminal]

curl 'myServer:9200/global/user/7a113e4f-44de-3b2b-a3f1-fb881da1b00a'
Run Code Online (Sandbox Code Playgroud)

结果是

{
  "_index": "global",
  "_type": "user",
  "_id": "7a113e4f-44de-3b2b-a3f1-fb881da1b00a",
  "found": false
}
Run Code Online (Sandbox Code Playgroud)

这似乎是在以前使用自定义脚本更新的文档上.

有任何想法吗?

elasticsearch

3
推荐指数
1
解决办法
1364
查看次数