我有一组div左右,像楼梯一样.也许有更好的方法,但我得到了它.
请注意,这些楼梯在页面的中间(水平)开始.如何根据这些楼梯数制作这个外部div而无需输入高度和宽度?
另一个重要的注意事项是,有时只有4个步骤,这意味着outter div必须根据显示的div进行调整.
如果你想查看它,你有一个小的plunker:
这是带有上述"楼梯"的css样式表
.box1 {
text-align: center;
border: 1px solid #eaeaea;
border-radius: 2px;
margin-left: 30%;
width: 8%;
height: 40px;
}
.box2 {
text-align: center;
margin-left: 38%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box3 {
text-align: center;
margin-left: 46%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box4 {
text-align: center;
margin-left: 54%;
border: 1px solid #eaeaea;
border-radius: 2px;
width: 8%;
height: 40px;
}
.box5 {
text-align: center; …Run Code Online (Sandbox Code Playgroud)我有一个带有以下CSS的标题:
.header{
display: block;
top: 0;
position: fixed;
width: 100%;
max-width: 1320px;
z-index: 10;
box-sizing:border-box;
}
Run Code Online (Sandbox Code Playgroud)
我在内容的容器中有无限滚动.在iOS 11中,当我滚动标题消失了一秒钟然后又回来了.
我尝试了以下修复:
transform: translate3d(0,0,0)
transform: translateZ(0)
-webkit-transform: translate3d(0,0,0);
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
我已经加入viewport-fit="cover",并viewport-fit="contain"在元视口代码了.如此处所示.
position: fixed;在CSS中. left: 0;. -webkit-overflow: hidden;到页面正文. overflow-x:hidden;到页面的html标签.所有上述解决方案都没有奏效.
我appendChild()在JavaScript中创建了树状结构.单击"添加"按钮时,将添加根节点.单击根节点时,将添加父节点.单击父节点时,将添加子节点.
现在我试图通过添加一个小图标来删除该添加.在单击该图标时,需要删除特定节点.
现在我尝试使用删除按钮.单击"删除"按钮后,根节点将被删除.但是只删除了一个节点.
function remove_div(){
var A = document.getElementById('test-0');
A.parentNode.removeChild(A);
}
Run Code Online (Sandbox Code Playgroud)
因为我只调用了一个ID.如何调用该特定id来删除该节点.我已动态生成ID.
div1.id = 'test-' + document.querySelectorAll('.ui-modal > .msg1').length;
Run Code Online (Sandbox Code Playgroud)
如何获取要删除的特定ID.单击根节点必须删除特定节点.类似于父节点和子节点
function add_div() {
var div1 = document.createElement('ul');
document.body.appendChild(div1);
div1.className = 'ui-modal';
div1.id = 'test-' + document.querySelectorAll('.ui-modal > .msg1').length;
div1.innerHTML = '<li class="msg1" onclick="event.stopPropagation();add_div2(this);">root</li>';
}
function remove_div() {
var A = document.getElementById('test-0');
A.parentNode.removeChild(A);
}
function add_div2(elem) {
var div2 = document.createElement('ul');
elem.appendChild(div2);
div2.className = 'sub-div';
div2.id = 'sub_test-' + document.querySelectorAll('.sub-div > .msg2').length;
div2.innerHTML = '<li class="msg2" onclick="event.stopPropagation();add_div3(this);">parent</li>';
}
function …Run Code Online (Sandbox Code Playgroud)几次尝试后我使用hbase 0.94.1和zookeeper 3.3.6,hbase的master关闭并且sw退出
这些是我从 shell 得到的错误
12/09/26 18:58:35 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
12/09/26 18:58:35 INFO zookeeper.ClientCnxn: Opening socket connection to server /127.0.0.1:2181
12/09/26 18:58:35 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 5133@xxx-xxx
12/09/26 18:58:35 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
12/09/26 18:58:35 WARN zookeeper.ClientCnxnSocket: Connected to an old server; r-o mode will be unavailable
12/09/26 18:58:35 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13a037edbb2000c, negotiated timeout = 40000
12/09/26 …Run Code Online (Sandbox Code Playgroud) 因此,当我将use ="required"属性放入 XML 分配的架构中时,我收到以下消息:
s4s-att-not-allowed:属性“use”不能出现在元素“element”中。
这是什么意思?它似乎根本不会影响我的代码,并且此分配需要 use 属性。
架构代码:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Inventory">
<xs:complexType>
<xs:sequence>
<xs:element name="Items" use="required">
<xs:complexType>
<xs:sequence>
<xs:element name="PartID" type="xs:ID" use="required"/>
<xs:element name="Part_Desc" type="xs:string" use="required"/>
<xs:element name="Price" type="xs:decimal" use="required"/>
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:sequence>
<xs:attribute name="vendor_id" type="xs:int" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Run Code Online (Sandbox Code Playgroud)
这是我的 XML 代码:
<?xml version="1.0" encoding="UTF-8"?>
<Inventory xsi:noNamespaceSchemaLocation="exam.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Items vendor_id="2">
<PartID>a101</PartID>
<Part_Desc>Keyboard</Part_Desc>
<Price>79.99</Price>
</Items>
<Items vendor_id="5">
<PartID>a404</PartID>
<Part_Desc>Wireless Mouse</Part_Desc>
<Price>59.99</Price>
</Items>
<Items vendor_id="3">
<PartID>a120</PartID>
<Part_Desc>2 GB …Run Code Online (Sandbox Code Playgroud) 在Eclipse中,当我们选择代码语句并右键单击它时,它为我们提供了一个围绕try/catch块的选项,在选择此选项之后我们的代码看起来就像.
try {
//selected code lines
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
现在我想定义一个自定义catch块,在try/catch从eclipse智能插入中选择带有块的环绕后,它应该如下所示:
try {
//selected code lines
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
myCustomLogger.LogMe(Log.getStackTraceString(e));
}
Run Code Online (Sandbox Code Playgroud)
可能吗?
Eclipse允许我们为智能插入中的特定项目定制一些属性吗?
我正在使用petl包,我已经使用pip在virtulaenv中安装了python 3.4.当我试图测试petl包是否正确安装在python shell中时我已经做了这个检查
$ python
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from petl import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.env/lib/python3.4/site-packages/petl/__init__.py", line 10, in <module>
from petl.util import header, fieldnames, data, records, rowcount, look, see, \
File "/home/user/.env/lib/python3.4/site-packages/petl/util.py", line 14, in <module>
from string import maketrans
ImportError: cannot import name 'maketrans'
>>>
Run Code Online (Sandbox Code Playgroud)
我试着检查字符串包中是否存在maketrans我运行它
>>> from string import maketrans …Run Code Online (Sandbox Code Playgroud) 任何人都知道我如何设置 Visual Studio 代码编辑器(Microsoft 编辑器)以便能够在代码中显示阿拉伯语字符串。如图所示,每当我写阿拉伯语字符串时,它都会显示为正方形。

我试着看了一下设置文件,字符集是utf8!我正在使用括号,它可以很好地处理阿拉伯字符串?
我有多个任务/可运行(即从互联网下载图像),这些任务是当用户滚动 Android 应用程序中的列表时生成的。
我无法控制一次生成多少个任务/Runnable,这可能是 100 个。但我只想并行执行 n(10) 个任务。因此,我计划构建一个设计,一旦生成新任务/可运行任务,它将被添加到队列 ( List<Runnable>) 中,并且通过Executors.newFixedThreadPool(10),我将仅并行执行前 10 个可运行任务。现在,一旦任务/Runnable 完成,我应该能够将它们从队列 ( List<Runnable>) 中删除,并且应该能够执行 FIFO 中队列中的新任务/Runnable。
我为这个设计开设了两个课程。第一个ExecutorManager是单例类,管理 10 个并行任务的执行,第二个是ImageDownloader实现runnable并负责下载图像的类。我不确定通知ExecutorManager任务/下载已完成并且可以从队列中执行新任务的最佳方式是什么。我遵循 FIFO,因此我总是从队列中的前 10 个任务开始执行,但是我如何知道哪个任务已完成以及哪个任务要从队列中删除?
public class ImageDownloader implements Runnable{
DownloadListener mDownloadListener;
public ImageDownloader(DownloadListener mDownloadListener, String URL){
this.mDownloadListener = mDownloadListener;
}
@Override
public void run() {
//Download the Image from Internet
//ToDo
//if Success in download
mDownloadListener.onDownloadComplete();
//if Error in download
mDownloadListener.onDownloadFailure();
//Inform the Executor Manager that the …Run Code Online (Sandbox Code Playgroud) 我在Android中有以下retrofit2,首先是标量转换器工厂,然后是gson转换器,但是当我调用字符串调用并且响应作为字符串出现时,它给了我例外“不是JSON对象:“成功”。
我错过了什么吗?
改造创建:
Retrofit retrofit = new Retrofit.Builder()
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(gson))
.baseUrl(IPService.END)
.client(new OkHttpClient.Builder().build())
.build();
Run Code Online (Sandbox Code Playgroud)
呼叫创建:
@POST("/friends/sendRequest")
Call<String> sendFriendRequest(...);
Run Code Online (Sandbox Code Playgroud)
调用执行:
Response<String> a = myApi.sendFriendRequest(...).execute();
Run Code Online (Sandbox Code Playgroud)
响应正文是“成功”。