我编写了一个函数来获取boolean数组,从数组arraylist<boolean>到boolean数组,但是我得到了错误:
类型ArrayList中的方法toArray(T [])不适用于参数(boolean [])
ArrayList<Boolean> fool = new ArrayList<Boolean>();
for (int i = 0; i < o.length(); i++) {
if (Integer.parseInt(o.substring(i,i+1))==1) {
fool.add(true);
} else {
fool.add(false);
}
}
boolean[]op=fool.toArray(new boolean[fool.size()]);
Run Code Online (Sandbox Code Playgroud)
如果我改变的类型boolean[]op来Boolean[]op,那是工作,但我需要boolean[]..
那我该如何获得boolean阵列呢?
我在Extjs.
那是我的模特
Ext.define('CatModel', {
extend: 'Ext.data.Model',
idProperty: 'id',
fields: [{
name: "name",
convert: undefined
}, {
name: "id",
convert: undefined
}]
});
Run Code Online (Sandbox Code Playgroud)
商店:
var store = Ext.create('Ext.data.TreeStore', {
model:'CatModel',
root: {
expanded: true
},
proxy: {
type: 'ajax',
reader: 'json',
url: 'item_access.jsp?fullpage=true&show_cat=1'
}
});
Run Code Online (Sandbox Code Playgroud)
和treePanel
var treePanel = Ext.create('Ext.tree.Panel', {
id: 'tree-panel',
title: 'Sample Layouts',
region:'north',
split: true,
height: 560,
minSize: 150,
rootVisible: false,
autoScroll: true,
store: store,
columns: [
{
xtype: 'treecolumn',
text: 'name',
flex: 2.5,
sortable: true,
dataIndex: …Run Code Online (Sandbox Code Playgroud) 我在页面中有一个大数据,需要发布到服务器.
所以我使用https://github.com/dankogai/js-deflate来缩小大数据.
看来工作正常.
helloworld - > w4tIw43DicOJL8OPL8OKSQEA
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<h1>Demo</h1>
<p>$Id: demo.html,v 0.4 2013/04/09 14:25:38 dankogai Exp dankogai $</p>
<dl>
<dt>Inflated + Base64-Decoded (Original):</dt>
<dd><textarea id="inflated" cols="64" rows="16" onkeyup="(function(that, dst){
setTimeout(function(){
dst.value = Base64.toBase64(RawDeflate.deflate(Base64.utob(that.value)));
},0)
})(this,$('deflated'))"></textarea></dd>
<dt>Deflated + Base64-Encoded (Compressed):</dt>
<dd><textarea id="deflated" cols="64" rows="16" onkeyup="(function(that, dst){
setTimeout(function(){
dst.value = Base64.btou(RawDeflate.inflate(Base64.fromBase64(that.value)));
},0);
})(this, $('inflated'))"></textarea></dd>
</dl>
<script src="./base64.js"></script>
<script src="../rawinflate.js"></script>
<script src="../rawdeflate.js"></script>
<script>
$ = function(id){ return document.getElementById(id) };
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

所以我希望通过将deflate的结果放入我得到错误的java代码来得到hellowold: …
我在Android Studio中创建了一个片段示例
并删除标签并添加webview看起来像:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity$DummySectionFragment">
<WebView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/webView"
android:layout_margin="0dp"
android:layout_alignParentRight="true"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

它在webview上有余量..
那么,我如何才能使webview填满这一领域呢?
例子我有一个字符串
"123<a>3213<b>3434343<c>,example <d><1><2><3>"
我希望通过符号获得内部文本 "<>"
如何获得列表 [a,b,c,d,1,2,3] ???
我有收音机
<input type="radio" name="<_WallForm>" value="=(1,2,3)">
Run Code Online (Sandbox Code Playgroud)
用脚本
n = n.replace('<', '\\<').replace('>', '\\>').replace('=', '\\=');
v = v.replace('<', '\\<').replace('>', '\\>').replace('=', '\\=');
f.find('input[type=radio][name=' + n + '][value=' + v +']').parent().parent().find('.selectPic').click();
Run Code Online (Sandbox Code Playgroud)
错误
Uncaught Error: Syntax error, unrecognized expression: input[type=radio][name=\<_WallForm\>][value=\=(1,2,3)]
怎么办?谢谢.