我正在使用最新的POI 3.5 for Excel阅读.我安装了Excel MS Office 2007,因为poi正在提供XSSF来执行数据.
对于15000行数据,它正在正常执行,但是当超过30000或100000或200000的限制时,它容易出现Java堆空间异常.
代码如下:
UATinput = new FileInputStream(UATFilePath);
uatBufferedInputStream = new BufferedInputStream(UATinput);
UATworkbook = new XSSFWorkbook(uatBufferedInputStream);
Run Code Online (Sandbox Code Playgroud)
我在Java堆大小的最后一行得到了Exception.我已经增加了大小-Xms256m -Xmx1536m,但是对于更多数据,它给出了Java堆空间异常.
XSSFWorbook的这个例外可以帮助我吗?
我使用以下代码为AutoCompleteTextView设置适配器(SimpleCursorAdapter)
mComment = (AutoCompleteTextView) findViewById(R.id.comment);
Cursor cComments = myAdapter.getDistinctComments();
scaComments = new SimpleCursorAdapter(this,R.layout.auto_complete_item,cComments,new String[] {DBAdapter.KEY_LOG_COMMENT},new int[]{R.id.text1});
mComment.setAdapter(scaComments);
Run Code Online (Sandbox Code Playgroud)
auto_complete_item.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Run Code Online (Sandbox Code Playgroud)
而thi是实际控件的xml
<AutoCompleteTextView
android:id="@+id/comment"
android:hint="@string/COMMENT"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="18dp"/>
Run Code Online (Sandbox Code Playgroud)
下拉列表似乎正常工作,并显示项目列表.当我从列表中做出选择时,我在textview中得到一个sqlite对象('android.database.sqlite.SQLiteCursor @'...).任何人都知道会导致这种情况,或者如何解决这个问题?
谢谢
好的我能够挂钩OnItemClick事件,但AutoCompleteTextView小部件的TextView.setText()部分在此之后更新.OnItemSelected()事件永远不会被触发,并且在首次显示下拉项时会触发onNothingSelected()事件.
mComment.setOnItemClickListener( new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
SimpleCursorAdapter sca = (SimpleCursorAdapter) arg0.getAdapter();
String str = getSpinnerSelectedValue(sca,arg2,"comment");
TextView txt = (TextView) arg1;
txt.setText(str);
Toast.makeText(ctx, "onItemClick", Toast.LENGTH_SHORT).show();
}
});
mComment.setOnItemSelectedListener(new OnItemSelectedListener() …Run Code Online (Sandbox Code Playgroud) 不幸的是,Java没有多行字符串文字的语法.如果IDE可以很容易地使用像这样的结构,那没问题
String x = "CREATE TABLE TEST ( \n"
+ "A INTEGER NOT NULL PRIMARY KEY, \n"
...
Run Code Online (Sandbox Code Playgroud)
使用Eclipse将多行String从剪贴板粘贴到Java源代码的最快方法是什么(以自动创建代码的方式).
我有一个包含a UITableView和a 的视图,UILabel据我所知,它完美无缺.我真的不想管理UIView和UITableView使用相同的控制器UITableViewController处理大量的内务管理和根据文档:
如果要管理的视图是一个复合视图,其中表视图是多个子视图之一,则必须使用UIViewController的自定义子类来管理表视图(和其他视图).不要使用UITableViewController对象,因为此控制器类调整表视图的大小以填充导航栏和选项卡栏之间的屏幕(如果存在).
为什么Apple警告不要使用它,如果我忽略这个警告将会发生什么?
更新:最初我引用Apple文档中的以下内容:
您不应该使用视图控制器来管理仅填充其窗口一部分的视图 - 即,只是应用程序内容矩形定义的区域的一部分.如果您希望有一个由几个较小视图组成的界面,请将它们全部嵌入到单个根视图中,并使用视图控制器管理该视图.
虽然这个问题可能与UITableViewController设计为全屏的原因有关,但问题并不完全相同.
lxmlPython 的软件包似乎在我的系统上完全破碎了.我不确定这个问题,因为似乎所有文件都已到位.我怀疑是问题所在__init__.py,但我没有足够的练习系统来做出准确的诊断或解决问题.
以下是一些我认为有助于诊断问题的代码:
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
>>> dir(lxml)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
>>> print lxml.__path__
['/usr/lib/python2.6/dist-packages/lxml']
>>> c = open("/usr/lib/python2.6/dist-packages/lxml/__init__.py", "r")
>>> for line in c:
... print line
...
# this is a package
>>> c.close()
>>> import os
>>> os.system("ls /usr/lib/python2.6/dist-packages/lxml/")
builder.py ElementInclude.py __init__.py sax.pyc
builder.pyc ElementInclude.pyc __init__.pyc usedoctest.py
cssselect.py _elementpath.py objectify.so usedoctest.pyc …Run Code Online (Sandbox Code Playgroud) 我是Linux的粉丝,但由于Linux中的英特尔无线驱动程序不好,我不得不切换到Windows 7.我在Windows中安装了Cygwin,并希望配置SSH以远程连接到我的笔记本电脑.
我在Google上搜索并找到了在Win 7上安装openssh服务器的信息,但运行时出现以下错误ssh-host-config:
bala@bala-PC ~ $ ssh-host-config yes *** Info: Creating default /etc/ssh_config file *** Query: Overwrite existing /etc/sshd_config file? (yes/no) yes *** Info: Creating default /etc/sshd_config file *** Info: Privilege separation is set to yes by default since OpenSSH 3.3. *** Info: However, this requires a non-privileged account called 'sshd'. *** Info: For more info on privilege separation read /usr/share/doc/openssh/READ ME.privsep. *** Query: Should privilege separation be used? (yes/no) no *** Info: Updating /etc/sshd_config …
我有这个程序
#include <iostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std ;
#if 0
namespace skg
{
template <class T>
struct Triplet ;
}
template <class T>
ostream& operator<< (ostream& os, const skg::Triplet<T>& p_t) ;
#endif
namespace skg
{
template <class T>
struct Triplet
{
// friend ostream& ::operator<< <> (ostream& os, const Triplet<T>& p_t) ;
private:
T x, y, z ;
public:
Triplet (const T& p_x, const T& p_y, const T& p_z)
: x(p_x), y(p_y), z(p_z) …Run Code Online (Sandbox Code Playgroud) 我是C的新手,对于目标C来说是新手.对于一个iPhone子类,Im声明变量我想让类中的所有方法都可以看到@interface类定义,例如
@interface myclass : UIImageView {
int aVar;
}
Run Code Online (Sandbox Code Playgroud)
然后我再次宣布它为
@property int aVar;
Run Code Online (Sandbox Code Playgroud)
然后我
@synthesize aVar;
Run Code Online (Sandbox Code Playgroud)
你能帮我理解三个步骤的目的吗?我做了不必要的事吗?
谢谢.
我刚刚下载了easy_install但是我在安装机械化时遇到了问题,我是否应该在任何时候解决站点包问题.在下面的第一次尝试中,我收到了一个错误.在下面的第二次尝试中,我得到的命令没有找到哪个是奇怪的,因为我知道它已经下载了.
names-computer:~ names$ cd /Users/names/Desktop/
names-computer:~/Desktop names$ sh /Users/names/Desktop/mechanize-0.1.9-py2.5.egg
/Users/names/Desktop/mechanize-0.1.9-py2.5.egg: /Users/names/Desktop/mechanize-0.1.9-py2.5.egg: cannot execute binary file
names-computer:~/Desktop names$ easy_install mechanize
-bash: easy_install: command not found
Run Code Online (Sandbox Code Playgroud) iphone ×2
java ×2
python ×2
android ×1
apache-poi ×1
c++ ×1
cocoa-touch ×1
cygwin ×1
easy-install ×1
eclipse ×1
escaping ×1
excel ×1
friend ×1
heap ×1
lxml ×1
mechanize ×1
multiline ×1
objective-c ×1
openssh ×1
outputstream ×1
package ×1
permissions ×1
properties ×1
ssh ×1
symfony1 ×1
templates ×1
uitableview ×1
windows-7 ×1
xss ×1