问题列表 - 第44781页

使用本地数组自动完成

以下作品:

$("#txtAllowSearch").autocomplete(
    { source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"] }
);
Run Code Online (Sandbox Code Playgroud)

但以下不起作用:

var $local_source = '["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]';

$("#txtAllowSearch").autocomplete(
    { source: $local_source }
);
Run Code Online (Sandbox Code Playgroud)

我不熟悉数组.

javascript jquery jquery-ui jquery-ui-autocomplete

0
推荐指数
1
解决办法
2159
查看次数

使用具有向后兼容性的onBackPressed()

我想使用onBackPressed()方法,仍然希望在2.0之前提供对Android SDK的支持.onBackPressed()是在Android SDK 2.0中引入的.但怎么办?

sdk android

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

如果我的SQL Server实例支持快照,请在C#中查找?

我想编写c#代码来进行快照备份( 如果可用).从SQL Server 2005版开始支持此功能,但仅限于企业版,但不支持Express或Standard版.

我的问题:如果连接的服务器支持快照备份(是Enterprise Edition 2005还是更新版或某种"hasFeature(...)),如何在C#中查找?

我目前的解决方案试图抓住以下代码.

sqlCommand.CommandText = String.Format("CREATE DATABASE {0} ON " +
    (NAME = {1}, FILENAME = \"{2}\" ) AS SNAPSHOT OF {1}",
        databaseBackupName,
        databaseName,
        filenameOfDatabseBackup);
sqlCommand.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)

如果我抓到了,SqlException我认为连接的服务器上没有支持.

但也许可能有其他原因导致失败,尽管数据库支持快照(即某些东西被锁定,连接被破坏,......)

理想的解决方案是sqlCommand.ExecuteNonQuery()找出是否支持该功能.

第二个最好的是如果我必须包含一些可以找到它的额外dll(?sqldmo?),但这会为项目创建一个额外的依赖项.

第三好的是某种异常处理.

.net c# t-sql sql-server

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

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

为什么"tr""onmouseover"事件不会触发

我有一张桌子:

<table id="someId" class="someClass" style="width:50%" border=1>
        <tr id="data">  
          <td>Row 0, Column 0</td>
          <td>Row 0, Column 1</td>
          <td>Row 0, Column 2</td>
        </tr>
        <tr id="data">  
            <td>Row 1, Column 0</td>
            <td>Row 1, Column 1</td>
            <td>Row 1, Column 2</td>
        </tr>
        <tr id="data">  
            <td>Row 2, Column 0</td>
            <td>Row 2, Column 1</td>
            <td>Row 2, Column 2</td>
        </tr>
    </table>
Run Code Online (Sandbox Code Playgroud)

我使用下面的Jquery来实现当鼠标悬停在行上时,行背景颜色将会改变的功能:

$("tr#data").onmouseover(
             function() {
                 $(this).css('bgcolor', '#77FF99');
             }
         );
Run Code Online (Sandbox Code Playgroud)

我也试过"悬停"两个都不工作,为什么?

jquery jquery-ui

0
推荐指数
1
解决办法
6539
查看次数

如何在html5中制作透明画布?

如何使画布透明?我需要因为我想把两幅画布放在一起.

html5 canvas

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

如何通过Eclipse混淆带有Proguard的apk?

我添加proguard.config=proguard.cfg到我的default.properties文件中,并在我的项目根目录中有一个proguard.cfg文件.如果我现在从Eclipse中使用Export as Android Application,我会收到以下错误:

[2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class.class] unexpectedly contains class [com/package.Class]
[2011-01-27 11:11:37 - Application] Warning: class [classes/com/package.Class2.class] unexpectedly contains class [com/package.Class2]
[2011-01-27 11:11:37 - Application] Note: there were 145 duplicate class definitions.
[2011-01-27 11:11:37 - Application] Warning: there were 146 classes in incorrectly named files.
[2011-01-27 11:11:37 - Application]          You should make sure all file names correspond to their class names.
[2011-01-27 11:11:37 - Application]          The directory hierarchies must correspond to the package …
Run Code Online (Sandbox Code Playgroud)

eclipse android proguard

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

WPF进度条样式

我在我的应用程序中使用了一个不确定的进度条,我得到了一系列水平运行的块的坏动画.是不是有像Vista或Windows 7更好的风格?

wpf

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

来自其他链接单元的垃圾

当我讨论这个话题时,我问自己以下问题。

是否存在翻译单元中一些未使用的代码将链接到 GCC 和 VC++ 等流行编译器的最终可执行代码(当然是在发布模式下)的情况?

例如假设我们有 2 个编译单元:

//A.hpp
//Here are declarations of some classes, functions, extern variables etc.
Run Code Online (Sandbox Code Playgroud)

以及源文件

//A.cpp
//defination of A.hpp declarations
Run Code Online (Sandbox Code Playgroud)

最后是主要的

//main.cpp
//including A.hpp library
#include "A.hpp"
//here we will use some stuff from A.hpp library, but not everything
Run Code Online (Sandbox Code Playgroud)

我的问题是。如果 main.cpp 中没有使用 A.hpp 中的所有内容怎么办?链接器是否会删除所有未使用的代码,或者在某些情况下,某些未使用的代码可以与可执行文件链接?

编辑:我对 G++ 和 VC++ 链接器感兴趣。

编辑:当然我的意思是在发布模式下。

编辑:我开始为这个问题提供赏金,以获得良好而完整的答案。我期待答案,它将解释在哪些情况下 g++ 和 VC++ 链接器链接垃圾以及它们能够从可执行文件中删除什么样的代码(不需要的函数、不需要的全局变量、不需要的类定义等...)以及为什么他们不能删除一些不需要的东西。

c++ optimization linker

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

actionscript中绑定存在的属性

我怎么能在actionscript中绑定存在属性,例如我希望图像仍处于中间的应用<mx:Image source="image.jpg" x="{this.width/2}"程序中...在mxml中,我这么做就像/> ...我不知道如何在没有事件处理程序的actionscript中做到这一点简单...我把这个代码放到application_creationCompleteHandler ..类似var image:Image = new Image(); image.source="image.jpg"; image.x=this.width/2;或者我把它放到另一个函数?我不能做例如updateComplete事件处理程序并在那里更改它...

谢谢帕维尔

apache-flex mxml flex3 actionscript-3 flex4

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