问题列表 - 第45301页

按特定条件删除数组元素

什么是最好的方法:我有两个数组:

a=[['a','one'],['b','two'],['c','three'],['d','four']]
Run Code Online (Sandbox Code Playgroud)

b=['two','three']

我想删除a包含元素的嵌套数组b,以获得:

[['a','one']['d','four']
Run Code Online (Sandbox Code Playgroud)

谢谢.

ruby arrays

8
推荐指数
2
解决办法
7518
查看次数

样式DT浮动DD左侧

我正在尝试设置定义列表的样式,使每个定义列表dt浮动到其相应dd元素的左侧.我用过:

dt {
    clear: both;
    float: left;
    width: 6em;
}
dd {
    margin-left: 6.5em;
}
Run Code Online (Sandbox Code Playgroud)

它尽可能地发挥作用.它很好地处理dd每个文本dtdd文本,足够长,可以跨越多行.

但是,我真的希望能够处理多个dt元素dd(这是有效的HTML)和dt比相应dd元素更高的元素(由于文本的长度导致行换行).在这一点上,造型崩溃,随后的dd元素与他们的不一致dt.

我已经尝试过各种各样的东西,例如浮动dd,这会打破多个dd元素的对齐.添加dd + dd { clear: both; }几乎可以工作,但现在长dd文本位于其下dt(更不用说旧版浏览器不遵守规则).

有没有人设法做到这一点?我真的不想放弃并使用表格,但也许这是合适的.

我的测试标记在这里:http://pastebin.com/nmAQ5Xdm

html css

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

如何强制可本地化的WinForms应用程序使用(默认)语言属性

我有4种不同语言的WinForms应用程序.整个应用程序是用英语编写的,但我从未将本地化设置为en或en-US.有没有办法用于从代码强制语言属性(默认).例如,假设当前线程是葡萄牙语,我关闭所有表单,更改当前线程的CultuInfo以使用(默认)语言并再次重新加载所有表单.有没有办法做到这一点?

谢谢

c# localization winforms

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

枚举/迭代活动中的所有视图?

有没有办法迭代您的Activity中的所有视图?就像是:

__CODE__或者其他的__CODE__扩展__CODE__,你可以使用的功能__CODE____CODE__和遍历所有的
包含意见.

希望这可以帮助.

android iterator

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

shared_ptr and the this-pointer

OK, I started using shared-pointers and pass shared-pointers as much as possible. No conversion to raw pointers anymore. This works good, except in this specific case:

Suppose we have a class that also is an observer on another class, like this:

class MyClass : public IObserver
   {
   public:
      MyClass (std::shared_ptr<SomeOtherClass> otherClass);
      void DoSomethingImportant();
   private:
      std::shared_ptr<SomeOtherClass> m_otherClass;
   };
Run Code Online (Sandbox Code Playgroud)

This class is used like this in my application:

std::shared_ptr<MyClass> myInstance(new MyClass(otherInstance));
...
myInstance->DoSomethingImportant();
Run Code Online (Sandbox Code Playgroud)

MyClass gets a shared-pointer to another class and stores …

c++ this shared-ptr this-pointer

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

Problems importing To Excel a HTML file With Multiple Css Classes On Elements

Excel looks that it does not understand the HTML attribute 'class' if several CSS classes are pointed for HTML element.

For example if "class='A B'" pointed to tag 'TD' Excel will use empty style for the tag.

I have these html code:

<style type="text/css">
TABLE.t1_table{
background-color:#828a3c;
border:solid 1px #3A6EA5;
padding-left:2px;
padding-top:2px;
padding-right:2px;
padding-bottom:2px;
font-style:italic;
font-variant:small-caps;
font-size:20px;
color:#6b3f07;
border-collapse:collapse;   
Run Code Online (Sandbox Code Playgroud)

}

TR.t1_ph TD{
background-color:#B0C4DE;
border:solid 1px #3A6EA5;
padding-right:6px;
font-weight:bold;
color:#3A6EA5;  
Run Code Online (Sandbox Code Playgroud)

}

TR.t1_co TD{
background-color:#103a70;
border:solid 1px #3A6EA5;
padding-right:6px;  
Run Code Online (Sandbox Code Playgroud)

}

</style>

<table class="t1_table" …
Run Code Online (Sandbox Code Playgroud)

css excel

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

Is there a way to make absolutely positioned divs expand the container?

I have html template - div#container inside body, and some absolutely-positioned divs in container w/o fixed height. Is there a way to expand container to 100% height of page?

Here is an image demostrating my problem: http://habreffect.ru/files/4f3/54ad48420/q.png

I understand, that absolutely positioned divs are "invisible" for container, but unfortunately i got browser window expanded. The problem is, that i can't make body to fit 100% of page, and if I make height:100% of body (and html) it will fit 100% …

html css

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

Checkout from a windows share

I have created a repository in a shared folder. Usually I simply mapped a drive and checked out the repository using a file URL:

svn checkout file:///T:\MyRepository .
where T: is \\mySharedFolder
Run Code Online (Sandbox Code Playgroud)

Is there some way how to specify in a url directly a path of a shared folder?

Something like:

svn checkout \\mySharedFolder\MyRepository .
Run Code Online (Sandbox Code Playgroud)

svn windows windows-share svn-checkout

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

jsp:param可以存储一个集合吗?

问候,这是问题所在.我有一个名为entList.jsp的页面,它与集合一起使用:

<c:forEach var = "pack" items = "${packingList}">
<!--Here goes something with outputting the pack instance in a required format-->
</c:forEach>
Run Code Online (Sandbox Code Playgroud)

一切都很好,参数packingList作为请求的属性被调用此页面的动作处理程序传递.实际上,packingList的类型为Collection <GenericBean>.

事实证明,这个页面(它存储的片段)实际上非常有用,并且可以在许多具有不同集合的地方使用.所以我试着像这样包含这个页面(在另一个页面中):

<jsp:include page="entList.jsp">
  <!-- Pass the required collection as a parameter-->
  <jsp:param name = "packingList" value = "${traffic.packingList}"/>
</jsp:include>
Run Code Online (Sandbox Code Playgroud)

但是,现在这个片段没有看到参数packingList.我试着像这样重写片段(因为现在它是一个参数):

<c:forEach var = "pack" items = "${param.packingList}">
<!--Here goes something with outputting the pack instance in a required format-->
</c:forEach>
Run Code Online (Sandbox Code Playgroud)

但现在它会生成异常,因为它将packingList视为字符串而不是集合.所以现在解决方案是这样的 - 在动作处理程序代码中将所需的集合设置为属性:

// This …
Run Code Online (Sandbox Code Playgroud)

jsp

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

从地址栏中删除#fragment标识符

嗨,我希望有人可以帮忙.我想隐藏地址栏中的片段标识符,而不是:

www.mydomain.com/example.html#something

我得到:

www.mydomain.com/example.html

当我点击一个锚标签.

我看了很多相关的问题和论坛,但仍然无法弄明白.我很确定我应该使用以下内容:

window.location.href.replace(/#.*/,''); //and or .hash
Run Code Online (Sandbox Code Playgroud)

放就是想不出来.

localScroll插件允许您隐藏或保留标识符,默认情况下它们是隐藏的.我认为很多画廊插件也有类似的选择.

但是当我尝试自己做的时候(一点新手)我发疯到没有结果.

下面是我希望它可以使用的一些基本示例脚本:

<style>
.wrap{
width:300px;
height:200px;
margin:auto;
}

.box{
width:300px;
height:200px;
position:absolute;
display:none;
}

#one{background:red;}
#two{background:blue;}
#three{background:green;}

.load{display:block;}
</style>


<body>
<ul>
    <li><a href="#one">One</a></li>
    <li><a href="#two">Two</a></li>
    <li><a href="#three">Three</a></li>
</ul>

<div class="wrap">
    <div id="one" class="box load">This is Box 1</div>
    <div id="two" class="box">This is Box 2</div>
    <div id="three" class="box">This is Box 3</div>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
$(document).ready(function() {

$("ul li a").click(function(){

       $("div.box").fadeOut(1000);

       $($(this).attr('href')).fadeIn(1000);

    });
});
</script>
</body>
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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