问题列表 - 第24105页

使用jquery从父div中删除内部div

考虑我的父div是parentDiv,它包含五个子div

<div id="parentDiv">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
</div>
Run Code Online (Sandbox Code Playgroud)

如何parentDiv 使用jquery 清空子元素....

编辑:

之间有什么差异empty()remove()?我应该用什么?

html jquery clear

6
推荐指数
1
解决办法
2万
查看次数

在Suds python中覆盖Soap Envelope

我有一个相机,我正试图连接它与泡沫.我试图发送原始的xml,并发现阻止xml suds工作的唯一因素是不正确的Soap信封命名空间.

信封命名空间是:

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

我想把它重写为:

xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"

为了在python中添加命名空间,我尝试以下代码:

message = Element('Element_name').addPrefix(p='SOAP-ENC', u='www.w3.org/ENC')

但是当我添加SOAP-ENV到命名空间时,它不会写,因为它被硬编码到suds绑定中.有没有办法在泡沫中覆盖这个?

谢谢你的帮助.

python xml soap suds envelope

6
推荐指数
2
解决办法
3840
查看次数

Selenium onChange无效

我尝试了很多尝试,让Selenium从下拉菜单中选择一个'onchange'事件,但没有一个有效.

违规的HTML是:

<select onchange="doOpperation(this.options[this.selectedIndex]); this.selectedIndex = 0;" name="opps_ondemand" id="opps_ondemand">
  <option value="none" id="ondemand">Mark as...</option>
  <option cmd="blah1" value="add">Something</option>
  <option cmd="blah2" value="remove">None</option>
</select>
Run Code Online (Sandbox Code Playgroud)

我已经读过Selenium IDE没有记录一些关于*事件的内容,因此使用fireEvent()是明智的:

$this->click("opps_ondemand");
$this->select("opps_ondemand", "label=Mark as...");
$this->click("//option[@value='add']");
sleep(3);
$this->fireEvent("//select[@id='opps_ondemand']", "change");
Run Code Online (Sandbox Code Playgroud)

但是,这不起作用(有或没有fireEvent).我也试过用

$this->fireEvent("locator", "click");
Run Code Online (Sandbox Code Playgroud)

代替

$this->click("locator");
Run Code Online (Sandbox Code Playgroud)

但这没有做任何事.

Selenium不会抱怨这些定位器不存在所以我假设它可以看到select/option元素没问题.问题似乎是onChange事件.

有谁知道如何解决这个问题?

谢谢.

events selenium onchange

10
推荐指数
2
解决办法
1万
查看次数

我怎么知道div元素的宽度

如何<div>在javascript中获取HTML 元素的宽度(以像素为单位)?

html javascript

2
推荐指数
1
解决办法
195
查看次数

Android - 无法播放任何视频(mp4/mov/3gp /等)?

我很难让我的Android应用程序播放SD卡上的视频.无论大小,比特率​​,视频格式或我能想到的任何其他设置都无关紧要,模拟器和我的G1都不会播放我尝试编码的任何内容.我也尝试了一些来自网络的视频(各种视频格式,比特率,有和没有音频轨道等),但这些都没有.

我不断得到的是一个对话框,上面写着:

"无法播放视频"

"抱歉,这部影片无法播放."

在LogCat中报告了错误,但我不理解它们,我试图在互联网上搜索没有任何运气的进一步解释.见下文:

03-30 05:34:26.807: ERROR/QCOmxcore(51): OMXCORE API :  Free Handle 390d4
03-30 05:34:26.817: ERROR/QCOmxcore(51):  Unloading the dynamic library for OMX.qcom.video.decoder.avc
03-30 05:34:26.817: ERROR/PlayerDriver(51): Command PLAYER_PREPARE completed with an error or info PVMFErrNoResources
03-30 05:34:26.857: ERROR/MediaPlayer(14744): error (1, -15)03-30 05:34:26.867: ERROR/MediaPlayer(14744): Error (1,-15)
Run Code Online (Sandbox Code Playgroud)

有时我也得到这个:

03-30 05:49:49.267: ERROR/PlayerDriver(51): Command PLAYER_INIT completed with an error or info PVMFErrResource
03-30 05:49:49.267: ERROR/MediaPlayer(19049): error (1, -17)
03-30 05:49:49.347: ERROR/MediaPlayer(19049): Error (1,-17)
Run Code Online (Sandbox Code Playgroud)

这是我正在使用的代码(在我的onCreate()方法中):

this.setContentView(R.layout.main);
//just a simple VideoView loading files from the SD …
Run Code Online (Sandbox Code Playgroud)

video android android-videoview

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

如何在PHP和ASP.net应用程序之间共享会话?

我公司拿了一些旧的php应用程序.由于我们偏爱ASP.net并且缺乏先前开发人员的任何文档,我们不希望花费太多资源来开发PHP.为了实现新功能,我们将创建一个与用户具有相同外观的Asp.net应用程序.我们希望开发一种"共存"的Web应用程序.因此,我们必须在PHP和Asp.net webapplication项目之间共享会话,因为存在涉及现有MySQL数据库的用户管理.

(例如,链接'A'指向PHP网站,链接'B'指向asp.net应用程序)

我们如何在PHP和asp.net应用程序之间共享会话?

是否有人暗示这种"共存"的东西,这可能对开发有用?

编辑:IIS 6将是我们的目标服务器,尽管IIS 7.5也是一个选项

php c# asp.net session

13
推荐指数
1
解决办法
1万
查看次数

XmlDocument SelectNodes(Xpath):结果顺序

这是来自MSDN的示例xml

<?xml version="1.0"?>
<!-- A fragment of a book store inventory database -->
<bookstore xmlns:bk="urn:samples">
  <book genre="novel" publicationdate="1997" bk:ISBN="1-861001-57-8">
    <title>Pride And Prejudice</title>
  </book>
  <book genre="novel" publicationdate="1992" bk:ISBN="1-861002-30-1">
    <title>The Handmaid's Tale</title>
  </book>
  <book genre="novel" publicationdate="1991" bk:ISBN="1-861001-57-6">
    <title>Emma</title>
  </book>
  <book genre="novel" publicationdate="1982" bk:ISBN="1-861001-45-3">
    <title>Sense and Sensibility</title>
  </book>
</bookstore>
Run Code Online (Sandbox Code Playgroud)

当我使用以下代码选择所有书籍节点时,这些节点将具有哪个顺序?

XmlDocument doc = new XmlDocument();
doc.Load("booksort.xml");

var nodeList =doc.SelectNodes("bookstore/book");
Run Code Online (Sandbox Code Playgroud)

nodelist中项目的顺序是否与xml中的顺序相同?这个订单有保证吗?

c# xml xpath xmldocument

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

C++浮点指向整数类型转换

在C++中用于将float类型的数据转换为整数的不同技术有哪些?

#include <iostream>

using namespace std;
struct database {
  int id, age;
  float salary;
};

int main() {
  struct database employee;
  employee.id = 1;
  employee.age = 23;
  employee.salary = 45678.90;
  /*
     How can i print this value as an integer
     (with out changing the salary data type in the declaration part) ?
   */
  cout << endl << employee.id << endl << employee.
  age << endl << employee.salary << endl;
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ floating-point integer type-conversion typecast-operator

28
推荐指数
4
解决办法
15万
查看次数

Maven eclipse不会添加依赖项

我的pom.xml中有以下片段(下面附有完整的pom,可以执行)

<dependency>
    <groupId>aspectj</groupId>
    <artifactId>aspectjrt</artifactId>
    <version>1.5.3</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

在我的一个Java文件中,我引用了一个类org.aspectj.lang.ProceedingJoinPoint.当我执行"mvn clean install"时,它编译并构建正常但是当我执行eclipse时:eclipse,并在eclipse中导入项目它会给我一个错误The import org.aspectj cannot be resolved.我检查了生成的.classpath文件,但没有该文件的条目.我尝试了一个"mvn依赖:树",它列出了这个很好.

我没有任何花哨的设置没有编译任何java文件.这只是一个困扰我的常规pom.

谁能告诉我这里出了什么问题?

更新1:我正在使用maven eclipse插件版本:2.7

更新2:只需使用下面的pom并mvn eclipse:clean eclipse:eclipse从命令行执行操作

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ekanathk</groupId>
    <artifactId>stackoverflow</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.5.3</version>
        </dependency>
        <dependency>
            <groupId>aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.5.3</version>
        </dependency>
    </dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

java maven-2

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

python mechanize.browser submit()相关问题

我用mechanize.browser模块制作一些脚本.

其中一个问题是所有其他的东西都可以,但是当提交()表单时,它不起作用,

所以我发现了一些怀疑来源部分.

在html源代码中我被发现如下.

<form method="post" onsubmit="return loginCheck(this)" name="FRMLOGIN"/>
Run Code Online (Sandbox Code Playgroud)

即时通讯思考,loginCheck(this)提交表单时出现问题.

但是如何用机械化模块处理这种javascript函数,所以我可以

成功提交表格并可以收到结果?

folloing是我目前的脚本来源.

如果有人可以帮助我..很欣赏!!

# -*- coding: cp949-*-
import sys,os
import mechanize, urllib
import cookielib
from BeautifulSoup import BeautifulSoup,BeautifulStoneSoup,Tag
import datetime, time, socket
import re,sys,os,mechanize,urllib,time


br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
br.set_cookiejar(cj)

# Browser options
br.set_handle_equiv(True)
br.set_handle_gzip(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)

# Follows refresh 0 but not hangs on refresh > 0
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)

# Want debugging messages?
br.set_debug_http(True)
br.set_debug_redirects(True)
br.set_debug_responses(True)

# User-Agent (this is cheating, ok?)
br.addheaders = [('User-agent', 'Mozilla/5.0 …
Run Code Online (Sandbox Code Playgroud)

python mechanize

6
推荐指数
1
解决办法
5385
查看次数