MDA/MDD/TDD/DDD/DDDDDDD
posts - 536, comments - 111, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

The Jakarta Commons team is glad to announce the availability of commons-fileupload 1.2. Commons Fileupload is a framework for handling HTTP file upload requests in servlets, portlets, and similar server side Java applications.
Compared to the previous version 1.1.1, the following notable changes have been made:
    * A streaming API has been added. The streaming API allows to handle arbitrarily large files without intermediary files while still keeping an extremely low memory profile.
    * The presence of a content-length header is no longer required.
    * Added support for progress listeners.
    * Added support for header continuation lines.
    * Added support for limiting the actual file size, as opposed to the request size.

posted @ 2008-09-27 12:34 leekiang 阅读(343) | 评论 (0)编辑 收藏

How to exclude DLLs from the distribution

Sometimes, Python extensions require supporting DLLs from the system. One example of this is cx_Oracle, which requires the Oracle client software in order to do its job. Because cx_Oracle.pyd depends on the Oracle OCI library, py2exe's dependency tracking includes the file OCI.dll from the Oracle distribution in the distribution directory.

However, it is not appropriate to include OCI.dll with your software, as it is specific to the version of the Oracle client software on the target machine, and is not useful in isolation.

So, you need to tell py2exe to exclude this DLL from the resulting distribution. The dll_excludes option lets you do this (it's documented in the docstring for the py2exe module). It does not work from the command line, but you can include it in your setup.py as described in PassingOptionsToPy2Exe
setup(
options = {"py2exe": { "dll_excludes": ["oci.dll"]}},
...
)
来源:http://www.py2exe.org/index.cgi/ExcludingDlls

posted @ 2008-09-27 12:20 leekiang 阅读(729) | 评论 (0)编辑 收藏

tomcat里配p6spy,如果tomcat在program files下,会报找不到驱动的错误,看来目录名不能有空格

posted @ 2008-09-26 22:32 leekiang 阅读(303) | 评论 (0)编辑 收藏

1,突然发现有些老外的软件里remove和delete区分得很清楚,而我们一律翻译为"删除"

posted @ 2008-09-26 16:08 leekiang 阅读(211) | 评论 (0)编辑 收藏

1,用filezilla服务器时可以方便的给一个用户分配多个目录,先设置一个主目录,别的目录可以用别名(必须以"/"符号开头),这样别的目录就虚拟为主目录下的子目录了。不知道支不支持设置局域网里的其他机器的文件夹,要是支持就更好了。

2,ftp 文件上传服务器设置的几点经验和窍门!
http://hi.baidu.com/wgzx/blog/item/554976affaa3d1fffbed5098.html

3,FileZilla FTP Server安装设置教程
FileZilla Server Interface-->edit-->settings-->general settings-->Max.Number of users(允许最大并发连接客户端的数量)

4,http://www.blogjava.net/yegucheng/archive/2007/10/26/156008.html
在使用apache的net包处理Serv-U和x-lighgt时遇到的几点不同
进入一个空目录:
 在serv-U下,调用fTPClient.changeWorkingDirectory("")方法没有任何问题(指向一个空的目录)
 在x-light下,调用方法,会返回501信息
当下载完文件后:
 使用 fTPClient.retrieveFileStream(url)方法下载文件,在serv-U下,可以直接下载下一个文件
 但是在x-light下,调用 fTPClient.retrieveFileStream(url)方法后,
 必须执行 fTPClient.completePendingCommand()方法,关闭当前下载操作,
 才能执行下一个下载任务(在net包的API中有相关的规定)。

5,摘自http://blog.csdn.net/wangjian5748/archive/2008/11/28/3404619.aspx
commons-net的FTPClient,在使用public InputStream retrieveFileStream(String remote)
方法时需要特别注意,在调用这个接口后,一定要手动close掉返回的InputStream,然后再调用completePendingCommand方法,若不是按照这个顺序,则不对,伪代码:
  1. InputStream is = ftpClient.retrieveFileStream(remote);
  2. is.close();
  3. ftpClient.completePendingCommand();
retrieveFileStream的API文档说的有点罗嗦,还可以使用下列方法来替换上述使用方式
使用一个中间文件来做一个转接,这种方式比上述方法的好处就是自己容易控制,不容易出问题。伪代码如下:
  1. File localFile = new File(localPath, localFileName);
  2. OutputStream output = new FileOutputStream(localFile);
  3. ftpClient.retrieveFile(remoteFileName, output);
  4. output.close();
  5. InputStream input = new FileInputStream(localFile);
关于原因这里有比较具体的分析:http://marc.info/?l=jakarta-commons-user&m=110443645016720&w=2
简单来说:completePendingCommand()会一直在等FTP Server返回226 Transfer complete,但是FTP Server只有在接受到InputStream执行close方法时,才会返回。所以先要执行close方法

6,
Java实现的ftp服务器 源代码

7,java ftp
http://hi.baidu.com/montaojavahome/blog/item/d8d2691e1236241940341722.html

使用J-FTP上传下载



posted @ 2008-09-26 16:02 leekiang 阅读(981) | 评论 (0)编辑 收藏

1,以下是一些零碎的记录,不全。
//字段为java.sql.Blob类型
Fj fj = new Fj();
fj.setAttblob(Hibernate.createBlob(
new byte[1]));//用empty_blob()替换?
session.save(fj);
session.flush();
session.refresh(fj, LockMode.UPGRADE);
org.hibernate.blob.SerializableBlob sb 
=
(org.hibernate.blob.SerializableBlob) fj.getAttblob();
oracle.sql.BLOB blob 
= (oracle.sql.BLOB) sb.getWrappedBlob();
OutputStream os 
= blob.getBinaryOutputStream();
//------

2,用jdbc读取CLOB
http://hi.baidu.com/xh28025/blog/item/f61c2df1ef8130c47831aa70.html
String description = ""
   query 
= "select picstr from clobtest_table where id = '001'";
pstmt 
= con.prepareStatement(query);
ResultSet result 
= pstmt.executeQuery();
if(result.next()){
   oracle.jdbc.driver.OracleResultSet ors 
=
   (oracle.jdbc.driver.OracleResultSet)result;
   oracle.sql.CLOB clobtmp 
= (oracle.sql.CLOB) ors.getClob(1);

   
if(clobtmp==null || clobtmp.length()==0){
   System.out.println(
"======CLOB对象为空 ");
   description 
= "";
   }
else{
   description
=clobtmp.getSubString((long)1,(int)clobtmp.length());//从1开始?
   System.out.println(
"======字符串形式 "+description);
   }
}


posted @ 2008-09-24 14:01 leekiang 阅读(496) | 评论 (0)编辑 收藏

1,commons-net ftpclient 怎么判断服务器是否存在文件A?
FTPFile[]   ftpFiles   =   ftp.listFiles("a");  
  System.out.println(ftpFiles.length);

2,http://www.blogjava.net/sterning/archive/2007/10/22/154861.html

3,乱码问题.
应用服务器在unix上,ftp在window上,下载时换行处可能有问题,
 解决:将文件传输类型设置为二进制
     ftpClient.setFileType(
FTP.BINARY_FILE_TYPE);
 见
public InputStreamretrieveFileStream(String path)方法的注释:
If the current file type is ASCII, the returned InputStream will convert line separators in the file to
the local representation.
commons.net包中的FTPClient.listFiles()方法返回null的问题及其解决方案
http://hi.baidu.com/3seefans/blog/item/667e32afa0a58bc97cd92aa2.html
http://hi.baidu.com/hzwei206/blog/item/7c901d2debf7e136359bf7cd.html
 
6,
http://zjsoft.javaeye.com/blog/189874
http://topic.csdn.net/t/20050820/13/4220332.html
http://www.cnblogs.com/swingboat/archive/2005/05/31/165613.html
http://www.onflex.org/ted/2007/05/flexftp-ftp-client-in-flex-using.php
http://tech.it168.com/j/2007-10-18/200710182058687.shtml
http://hi.baidu.com/3seefans/blog/item/667e32afa0a58bc97cd92aa2.html

posted @ 2008-09-22 04:03 leekiang 阅读(456) | 评论 (0)编辑 收藏

1,MySQL删除表中大批量的数据
有1800万条,直接执行 DELETE FROM osc_logs WHERE status=1 会发现删除失败,lock wait timeout exceed。可以分批来删除,比如每10000条进行删除

DELETE FROM osc_logs WHERE status=1 ORDER BY log_id LIMIT 10000;

然后分多次执行就可以把这1800万条记录成功删除。

来源:http://www.javayou.com/diary/146633154?catalog=4


posted @ 2008-09-20 02:01 leekiang 阅读(83) | 评论 (0)编辑 收藏

1,B 树、 B- 树、 B+ 树、 B* 树都是什么
http://www.cppblog.com/qiujian5628/articles/42190.html

2,红黑树
http://baike.baidu.com/view/133754.htm

3,AVL树
http://zh.wikipedia.org/wiki/AVL%E6%A0%91

4,分析代码的时空复杂度(图n最短路径算法)

posted @ 2008-09-20 01:54 leekiang 阅读(241) | 评论 (0)编辑 收藏

除了fckeditor,又发现一款可能更好的tinymce
TinyMCE 和 FCKEditor的差別和好壞之處在哪?

posted @ 2008-09-20 01:32 leekiang 阅读(191) | 评论 (0)编辑 收藏

仅列出标题
共54页: First 上一页 31 32 33 34 35 36 37 38 39 下一页 Last