小编C_B*_*C_B的帖子

Eclipse ADT更新不起作用

我更新了我的android sdk,我尝试通过ecplise更新我的adt

帮助 - >检查更新

此操作会导致对话框显示:

没有找到更新

但我的SDK说:

这个android是SDK需要Android开发工具包21.1.0或以上当前版本是21.1.0.v201212060256-543035

请将ADT更新到最新版本.

帮助我,你有我不朽的感激之情.

android eclipse-plugin updates adt

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

如何让Android应用程序无限期运行?

我正在编写一个Android应用程序,必须始终在后台运行,直到用户从应用程序菜单中退出.但是现在我注意到在一段时间后我的应用程序在没有用户干预的情况下自行停止.

知道如何确保我的应用程序将始终在后台运行吗?

service android

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

使用Xerces将DOM序列化为FileOutputStream

我正在使用链接使用DOM生成XML文件.它说"Xerces解析器与JDK 1.5发行版捆绑在一起.所以你不需要单独下载解析器."

但是,当我在Eclipse Helios中编写以下行时,即使我的系统中有Java 1.6,它也会产生编译时错误.

import org.apache.xml.serialize.XMLSerializer;
Run Code Online (Sandbox Code Playgroud)

为什么会这样?

java xml dom xerces

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

Apache Bench:SSL握手失败与并发级别直接相关

我在ab上运行了一些测试,当我使用超过155的并发级别时,我得到以下内容:

SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
SSL handshake failed (5).
Completed 100 requests
Completed 200 requests
Finished 200 requests
Run Code Online (Sandbox Code Playgroud)

请求仍然成功:

Concurrency Level:      200
Time taken for tests:   14.481 seconds  
Complete requests:      200
Failed requests:        0
Run Code Online (Sandbox Code Playgroud)

我已经多次测试过,只有当并发度超过155时,SSL握手才会失败.有人可以向我解释它们是如何直接相关的吗?

ssl apachebench sslhandshakeexception

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

jQuery ajax回到$ _POST而不是REQUEST有效负载

我记得我去年使用jQuery ajax帖子,我可以通过输入简单地获取帖子数据$_POST['param'].今天我再次使用它来进行项目,所以我加载了最新的jQuery lib并使用了以下代码:

<script type="text/javascript">
    $(document).on('submit', '.ajaxform', function(e){
        e.preventDefault();

        var datastring = $(this).serialize();

        $.ajax({
            type: "POST",
            data: datastring,
            contentType: "application/json; charset={CHARSET}",
            dataType: "json",
            beforeSend: function(){
                console.log($(this).serialize());
            },
            success: function(data){
                alert('yes');
            },
            error: function(errMsg){
                alert('error');
            }
        });
    });
</script>
<form action="" id="register" name="register" class="ajaxform" method="post" enctype="multipart/form-data">

    <input type="text" name="username" value="" />
    <input type="password" name="password" value="" />

    <input type="hidden" name="action" value="register" />
    <input type="hidden" name="{TOKENID}" value="{TOKEN}" />

    <input type="submit" value="Register" />

</form>
Run Code Online (Sandbox Code Playgroud)

提交后,我无法通过键入获取输入字段值$_POST['username'].

我检查了检查元素,我注意到有些不同.

Request URL:http://project0/member.php …
Run Code Online (Sandbox Code Playgroud)

php jquery header http

7
推荐指数
1
解决办法
5993
查看次数

myIntent.getStringExtra返回null?

当我在切换活动时尝试发送带有意图的字符串时,我遇到了一个奇怪的问题.

这是我在第1课中所做的:

Intent myIntent = new Intent(SearchText.this, Search.class);  
myIntent.putExtra("searchx", spinnerselected);  
myIntent.putExtra("SearchText", input);  
startActivity(myIntent); 
Run Code Online (Sandbox Code Playgroud)

第2类:

Intent myIntent = getIntent();   
searchText=myIntent.getStringExtra("SearchText");  
spinnerselectednumber=Integer.parseInt(myIntent.getStringExtra("searchx"));
Run Code Online (Sandbox Code Playgroud)

并且在第二类中使用调试器,它清楚地表明searchx中有一个值 .

虽然线路myIntent.getStringExtra("searchx")返回null .

为什么是这样?

android android-intent

5
推荐指数
1
解决办法
7762
查看次数

无法编辑主机文件

我一直在尝试编辑我的主机文件一段时间,但我一直都在失败.我试图以管理员身份打开记事本,然后单击文件 - >打开并选择主机文件,但是收到以下错误消息:

主机

您无权打开此文件.

请与文件所有者或管理员联系以获取权限.

我也尝试过notepad ++(作为管理员),但我甚至无法使用它来访问该文件(它没有在驱动程序中显示etc文件夹).我还尝试检查我的" 用户帐户控制设置 ",但它已经处于最低级别(从不通知).在寻找解决方案的同时,我注意到有更多人遇到同样的问题,但我找不到适合我的解决方案.

我正在运行Windows 7 Home Premium 64位

permissions file-permissions notepad++ permission-denied windows-7

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

Hibernate persistance.xml:由于连接为空而禁用上下文 LOB 创建

我的persistence.xml

<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
  version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
  <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
    <class>com.ibm.apiscanner.DTO.BaselineDTO</class>
    <properties>
      <property name="hibernate.connection.driver_class" value="com.ibm.db2.jcc.DB2Driver" />
      <property name="hibernate.connection.url"    value="jdbc:db2://localhost:{PORT}/{DB}" />
      <property name="hibernate.connection.username" value="{user}" />
      <property name="hibernate.connection.password" value="{password}" />
      <property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>
      <property name="show_sql" value="true"/>
      <property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
    </properties>
  </persistence-unit>
</persistence>
Run Code Online (Sandbox Code Playgroud)

我收到以下信息:

Jan 22, 2015 9:16:48 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.DB2Dialect
Jan 22, 2015 9:16:48 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000422: Disabling contextual LOB creation as connection was null
Run Code Online (Sandbox Code Playgroud)

通过基本 JDBC 连接时,可以使用相同的 url、用户和密码组合。

有人有建议吗?

java xml hibernate jpa persistence.xml

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

将char初始化为256

我的好奇心让我变得更好.编写代码时会发生什么(或确实发生):

char pseudo_char = 256;
Run Code Online (Sandbox Code Playgroud)

它会存储值为256的虚拟字符吗?或者这是非法的,永远不应该这样做?

c++ ascii char

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

无法添加窗口 - 令牌null不适用于Service的应用程序

我读过很多像这样的问题,但似乎都没有解决我的问题.

问题在于:

 AlertScreen ad = new AlertScreen(SensorListenerService.this);
Run Code Online (Sandbox Code Playgroud)

在我的服务类中:

public class SensorListener extends Service implements SensorEventListener {

public int onStartCommand(Intent intent, int flags, int startId) {
    startForeground(Process.myPid(), new Notification());

    AlertScreen ad = new AlertScreen(SensorListener.this); //problem
    ad.show();

    return START_STICKY;
}
...
Run Code Online (Sandbox Code Playgroud)

它调用我的AlertScreen类:

public class AlertScreen extends AlertDialog {

public AlertScreen(Context context) {
    super(context);
}
...
Run Code Online (Sandbox Code Playgroud)

LogCat有什么要说的:

LocCat

谁能解释一下这个问题呢?

android android-alertdialog

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

如何在Gradle项目中生成war文件

我创建了一个示例gradle项目.我的项目构建生成一个jar文件.我正在使用该gradle clean build命令.如何为项目而不是jar文件生成war文件?

war gradle build.gradle

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