- 浏览: 47591 次
- 性别:
- 来自: 深圳
最新评论
-
showzh:
试了,咋不行呢?
Suse10环境下开机启动脚本的位置
文章列表
Resin3.x日志滚动
- 博客分类:
- Java
可以按照日志大小和时间滚动,对日志还支持压缩zip和gzip压缩
<stdout-log path-format="log/stdout.log.%Y%m%d" timestamp="[%Y-%m-%d %H:%M:%S] " rollover-period="1D" rollover-size="200mb" />
log name
value
Meaning
""
Debug everything
com.caucho.jsp
Debug jsp
com.caucho.java
Java compilation
com.caucho.xsl
XSL debugging
com.caucho.server.port
TCP port debugging and threading
com.caucho.server.port.AcceptPool
port thread creation
com. ...
List的遍历条件删除
- 博客分类:
- Java
List的遍历条件删除
List<Integer> l = new ArrayList<Integer>();
for (int i = 0; i < 10; i++) {
l.add(i);
}
// 方法1,目标是删除1
for (int i = 0; i < l.size(); i++) {
if (l.get(i) == 1) {
l.remove(i);
}
}
System.out.println(l);
// 方法2,目标是删除2
Iterator<Integer> it = l.itera ...
环境:
resin3.x
hibernate3
c3p0-0.9.1
单纯的使用hibernate,没有spring来配合,如果同一个resin下配置了多个c3p0连接池,则会报错,错误信息如下:
A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were close
d prior to undeployment. This may lead to ...
Hibernate3.6.1,MySQL5InnoDBDialect
如果hbm文件中property元素的type属性是string,则当不指定column中的length属性时,ddl中默认为varchar(255)。由于varchar(x)中x是与字符集有关系的,最多也就是65535,当指定的length超过65535时,hibernate知道肯定是不能用varchar了,所以自动选择用longtext,在小于等于65535的范围内,hibernate如实生成varchar(length)形式的ddl,能不能执行就看MySQL的了;
如果hbm文件中property元素的type属性 ...
Resin3.x日志级别
- 博客分类:
- Java
和java.util.logging.Level中的日志级别对应
声明为 Level
的 java.util.logging
中的字段
static Level
Level.
ALL
ALL 指示应该记录所有消息。
static Level
Level.
CONFIG
CONFIG 是用于静态配置消息的消息级别。
static
问题描述:
知识库经过精简之后做成了一个hr的版本,两个版本都要求使用海量分词,这个分词工具是用jni进行包装的,于是很自然的在两个web的lib下面分别放了一个aplit.jar作为jni入口,后来发现使用搜索的时候总是只有一个能用,另一个在加载海量分词动态库的时候挂起,也就是java的System.loadLibary函数,而且有一个规律,第一次加载这个库的web可以正常使用
解决:
这很自然的让人想起是loadLibrary这个函数有问题,于是另写一个测试用例,在纯java环境下多次加载同一个库,没有发现问题,是不是tomcat环境问题呢?很自然的怀疑web环境和纯ja ...
# Readme:
# use: make config
# use: make dir
# use: make
# use: make clean
# use: make rebuild
# use: make cleanall
# use: make test
# use: make
# firs of all, use "make config" or "make dir" to
# build a source files struct. and then,
# put your source files into ...
目录结构如下:
其中configure.in/Makefile.am需要配置
在at目录下执行autoscan,对于出现的错误不予理睬(据称乃是版本错误,在网上发现过不出错的截图:>)
autom4te: configure.ac: no such file or directoryautoscan: /usr/bin/autom4te failed with exit status: 1
将生成的configure.scan文件改名为configure.in文件,对该文件进行编辑
AC_INIT(at, 1.0, robinmei@tencent.c ...
recvfrom的最后一个参数返回往客户端机构中写的数据字节数,这里应该使用sizeof()来求出sockaddr_in的大小,然后赋值给最后一个参数,否则取到的客户端地址不对而且不能正确发送返回数据
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(int l, int r)
{
return l < r; // 如果写死返回真则排序算法报错
}
int main(int argc, char** argv)
{
vector<int> v;
for (int i = 0; i < 10 ...
题目:现有6*6大小的棋盘和18张多米诺骨牌,每张牌能覆盖2个棋格,求将多米诺骨牌完全覆盖棋盘的所有组合?
#include <iostream>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <sstream>
using namespace std;
const int MAX_LENGTH = 2 * 3;
set<string> result;
//====== ...
split函数使用的分隔符需要注意特殊字符,比如正则表达式中的+/*以及|等,使用\\进行转义,否则会出现意外的情况
jpgraph配置显示中文的时候将字体文件simsun.ttf拷贝到/usr/X11R6/lib/X11/fonts/truetype/目录下,然后配-置jpg-config.inc.php文件,在使用的时候使用SetFout("FF_SIMSUN")来设置字体,在jpgraph_ttf.inc.ph-p文件中设置具体的字体格式,如粗体,斜体等等
用CGI输出文本文件已是司空见惯,输出二进制呢?你尝试过吗?
下面的代码演示在linux下想浏览器输出Excel文件
tt.cpp
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#include <sys/types.h>
#include <sys/stat.h>
#include ...