问题列表 - 第31713页

jQuery: Detect if element exists

In my code I have the following html that gets appended to a List Item when the user clicks on a specific element.

<span class="greenCheckMark"></span>
Run Code Online (Sandbox Code Playgroud)

Using jQuery, how would I detect if the element existed, and if so, not add another green checkmark?

$('.clickedElement').live('click',function(){
//does the green check mark exist? if so then do nothing, else 
$('#listItem).append('<span class="greenCheckMark"></span>');
});
Run Code Online (Sandbox Code Playgroud)

jquery jquery-selectors

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

how to search the computer for files and folders

i need a way to search the computer for files like Windows Explorer. i want my program to search lets say hard drive c:. i need it to search C:\ for folders and files (just the ones you could see in c:\ then if the user clicks on a file on the list like the folder test (C:\test) it would search test and let the user see what files/folders are in it.

c++ windows file

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

VBA: Difference between & and +

What is the difference between:

string1 + string2
Run Code Online (Sandbox Code Playgroud)

and

string1 & string2
Run Code Online (Sandbox Code Playgroud)

Are they equivalent? Why have two different symbols that do the same thing?

vba concatenation operators

8
推荐指数
1
解决办法
5593
查看次数

How do I get Maven to fail when conflicting versions of the same artifact are referenced?

I'd like my Maven build to fail if the same artifact is referenced with different versions in my dependency tree. This would seem like a fairly trivial option, but I can't work out how to do it. Any clues?

maven-2

22
推荐指数
1
解决办法
6437
查看次数

WebSockets versus Long-Polling versus TCP Scalability/Ease of Use

I'm writing a backend for a mobile web-app based in Java and I was wondering as far as scalability and ease of use go what are the pros and cons associated with using WebSockets versus Long-Polling solutions like comet. Another option would also be implementing my own solution using TCP. From what I've read it seems that you need to run Long-polling solutions on dedicated servers as they don't run well in Tomcat/Jetty when you start dealing with large numbers …

java long-polling websocket

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

.NET中的分布式锁定

我正在寻找适用于多台机器的锁定机制的建议。就我而言,我基本上只希望能够在2台计算机上启动服务,并阻塞一个直到另一个完成,这是确保在服务计算机出现故障时确保冗余的一种简单方法。

类似于分布式锁服务,但专门寻找人们已成功与.NET集成的项目。

.net locking distributed-lock

4
推荐指数
2
解决办法
5518
查看次数

Using Rhino Mocks to mock an out parameter, which is created within the method I am testing

Trying to mock the following method:

bool IsLoginValid(LoginViewModel viewModel, out User user);
Run Code Online (Sandbox Code Playgroud)

Tried this initially:

dependency<ILoginService>()
.Stub(serv =>
        serv.IsLoginValid(
            Arg<LoginViewModel>.Is.Equal(a_login_viewmodel),
            out Arg<User>.Is.Anything)
.Return(false);
Run Code Online (Sandbox Code Playgroud)

But, that fails, as it is an out parameter. Did a bit of searching around and altered my code like such:

dependency<ILoginService>()
.Stub(serv => 
        serv.IsLoginValid(
            Arg<LoginViewModel>.Is.Equal(a_login_viewmodel), 
            out Arg<User>.Out(new User()).Dummy))
.Return(false);
Run Code Online (Sandbox Code Playgroud)

That also fails. I need 'new User()' to be sort of an 'Anything' argument. As I think that is expecting a specific instance.

Any idea how to …

rhino-mocks

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

Does GWT linkers supports parameters?

I would like to reuse my GWT linker in several projects, with different configurations. Is it possible to define properties or parameters to the linker in my module configuration?

gwt

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

if xml element exists, exit or skip

how do i check in xml [with php dom] that if a particular element exists, it should not repeat it. for example, if i have an element 'activity', it should check against the xml file if this element exists, and if it does, it will not create it again.

in other words, i would like to create the element 'activity' only once in the beginning, but the other elements can be recurring.

this is the php code:

<?php
    header("Location: index.php"); …
Run Code Online (Sandbox Code Playgroud)

php xml domdocument

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

match and replace multiple newlines with a SED or PERL one-liner

I have an input C file (myfile.c) that looks like this :

void func_foo();
void func_bar();

//supercrazytag
Run Code Online (Sandbox Code Playgroud)

I want to use a shell command to insert new function prototypes, such that the output becomes:

void func_foo();
void func_bar();
void func_new();

//supercrazytag
Run Code Online (Sandbox Code Playgroud)

So far I've been unsuccessful using SED or PERL. What didn't work:

sed 's|\n\n//supercrazytag|void func_new();\n\n//supercrazytag|g' < myfile.c
sed 's|(\n\n//supercrazytag)|void func_new();\1|g' < myfile.c
Run Code Online (Sandbox Code Playgroud)

Using the same patterns with perl -pe "....." didn't work either.

What am I missing ? I've …

perl replace newline sed multiline

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