posts - 165, comments - 198, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

我的评论

共2页: 1 2 下一页 
re: 强大的 ant scp 和 sshexec G_G 2008-12-24 16:24  


<?xml version="1.0" encoding="UTF-8"?>
<project name="ssh">
<property file="ssh.properties" />
<tstamp>
<format property="TODAY" pattern="yyyyMMddHHmm" />
</tstamp>
<property name="ssh.path" value="/data/meganotes/shell/" />


<target name="shell/ 文件 上载/覆盖">
<input addproperty="scp_coverage_shell_file"
message="输入(ssh/ 下文件名 \n\r 上载或覆盖 到服务器 218 ${ssh.path} ):">
</input>
<input
message="请确定是否使用 ssh/${scp_coverage_shell_file} 覆盖服务器中 ${ssh.host}:${ssh.path}${scp_coverage_shell_file} (y,n)"
validargs="y,n" addproperty="do.coverage" defaultvalue="n" />
<condition property="do.abort">
<equals arg1="n" arg2="${do.coverage}" />
</condition>
<fail if="do.abort">退出</fail>

<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="
mkdir -p ${ssh.path}backup/${TODAY} ;
if [ -f ${ssh.path}${scp_coverage_shell_file} ] ;
then
cp ${ssh.path}${scp_coverage_shell_file} ${ssh.path}backup/${TODAY}/ ;
fi ;
">
</sshexec>
<scp file="ssh/${scp_coverage_shell_file}"
todir="${ssh.myName}:${ssh.myPass}@${ssh.host}:${ssh.path}"
trust="true" verbose="true" />

<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="chmod 777 ${ssh.path}${scp_coverage_shell_file}">
</sshexec>
</target>

<target name="shell/ 文件查看">
<input addproperty="show_shell_file" message="输入查看文件名(*sh):"
defaultvalue="*">
</input>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="ls /data/meganotes/shell/${show_shell_file}">
</sshexec>
</target>

<target name="shell/ 文件拷贝">
<input addproperty="scp_shell_file"
message="输入 /data/meganotes/shell/ 下需要文件名(cp 到 ssh 下):">
</input>
<scp
file="${ssh.myName}:${ssh.myPass}@${ssh.host}:/data/meganotes/shell/${scp_shell_file}"
todir="ssh" trust="true" verbose="true" />
</target>



<target name="admin-mvn组合操作">
<exec executable="cmd">
<arg value="/c" />
<arg value="${basedir}/sh/mvn/meganotes_mvn_clear.bat" />
</exec>
<exec executable="cmd">
<arg value="/c" />
<arg value="${basedir}/sh/mvn/meganotes_mvn_install.bat" />
</exec>
<exec executable="cmd">
<arg value="/c" />
<arg value="${basedir}/sh/mvn/mn_mod_admin_mvn_intall.bat" />
</exec>
</target>


<target name="admin-tomcat日志">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.adminRunLog}">
</sshexec>
</target>

<target name="schedule-tomcat日志">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="${ssh.scheduleRunLog}">
</sshexec>
</target>
<target name="查找2008/下Mp3没转128-64文件夹">
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.64k}">
</sshexec>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true" command="${ssh.128k}">
</sshexec>
<sshexec host="${ssh.host}" username="${ssh.myName}"
password="${ssh.myPass}" trust="true"
command="${ssh.128kto64k.err}">
</sshexec>
</target>

<target name="admin模块测试">
<input addproperty="admin_test_input"
message="测试类输入(Video*Test):" defaultvalue="*Test">
</input>
<echo message="${admin_test_input}"></echo>
<exec executable="cmd">
<arg value="/c" />
<arg
value="${basedir}/sh/admin_test.bat ${admin_test_input} " />
</exec>
</target>
</project>
re: 2008-9-23 E G_G 2008-09-26 09:43  
offers 提出
integration 综合
extendsive 宽广
standard 标准
re: 支付宝终于支持Firefox了 G_G 2008-09-15 18:55  
终于连 虚拟机里的 windows 也可以不要了
不支持 Linux 上浏览器 FireFox ; Opera。。
匹配多行

public class Main {
public static void main(String[] args) {
String str = "<html>\r\n" +
"<body>\n" +
"<h1>title</h1>\r\n" +
"<h2>title2</h2>\r\n" +
"</body>\r\n" +
"</html>\n";
Pattern pattern = Pattern.compile("<body>[\\S\\s]*?</body>");
Matcher matcher = pattern.matcher(str);
while( matcher.find()){
System.out.println("______________");
System.out.println( matcher.group() );
}

}
}


结果:
______________
<body>
<h1>title</h1>
<h2>title2</h2>
</body>

http://www.codepub.com/info/2007/02/info-11598-6.html参考
不顶 不行
谢谢了
支持下

不敢使用 jdbc 的人
jdbc4.0 已经很强大了 ;我们应该直面 她
Java SE 6中的JDBC 4.0增强
http://dev2dev.bea.com.cn/techdoc/20061025892.html
re: 一道题面试题! G_G 2008-07-31 10:22  
谢谢提醒
我收集到 int[] iis 数据后直接返回 !
不过 我使用的 Map,Collection 只是为 返回后 的使用方便哦!
最核心的 循环体内 是使用基本数据类型 ,还是 单元操作
if(
( itmp >=int_a && itmp<=int_z ) ||
( itmp>=int_A && itmp<=int_Z ) | (itmp=(itmp+(int_a-int_A)))>=int_a
){
iis[itmp-int_a]++ ;
}

当了也是出于私心 秀下 自己对 jdk 的了解了 ^_^
有点感触 !
re: SQL语句性能调整原则 G_G 2008-07-24 09:45  
拜读
谢谢了
re: 我的 ssh demo G_G 2008-06-27 09:44  
文件下载路径以修改
re: Html Parse 最佳实践 G_G 2008-06-19 14:09  
同意上楼 说的
re: Hibernate 级联添加删除 G_G 2008-06-16 16:05  
你参考下此文档 第2点第一条
Hibernate 数据库设计_1
在此我还没用 spring
不 好意思
re: 权限设计的探讨阅读后感 G_G 2008-04-14 09:20  
@一农
谢谢提醒!
re: 分页查询+hbn G_G 2008-03-12 13:58  
taglib uri 中有 html
http://jsptags.com/tags/navigation/pager
自己去看看吧
@Slipper Feng
软件质量是做出来的,不是测出来的!!
re: 解析Java Class文件格式 G_G 2008-01-30 09:23  
占个位置 等!!!
@隔叶黄莺
谢谢提醒
re: 改变开发方式的 hbm+rmic G_G 2007-12-24 18:30  
对于刚接触 EJB 的我 来说
这原理的 使用 还是 很吸引 我的

@隔叶黄莺
我们位置不同吧!你可能已经一大牛了
呵呵
re: 什么是人才?[未登录] G_G 2007-12-15 13:02  
没什么话说
对我们繁华的80年 是一次很好的教育
感谢
re: EJB小例 G_G 2007-12-05 16:23  
大哥说:

Skynet :
RemoteBinding 那他的用途是什么?
☆蓝蓝心情★ 16:19:57
Jboss的对JPA的实现采用Hibernate,而其他的公司,如bea,sun等的实现采用的oracle公司的 toplink
Skynet 16:20:02
RemoteBinding 那他的用途是什么?
☆蓝蓝心情★ 16:20:22
你以前搞过Hibernate,就到jboss的JPA实现上展示下身手
☆蓝蓝心情★ 16:20:35
设置远程JNDI名字
☆蓝蓝心情★ 16:20:57
所以客户端在通过JNDI lookup的时候,用的就是这个名字
☆蓝蓝心情★ 16:21:33
不同中间件的实现,默认JNDI名字是不一样的,所以不一定是***/Remote或***/Local
☆蓝蓝心情★ 16:22:00
相当于我们今天RMI的那个serviceName一样
☆蓝蓝心情★ 16:22:07
bind方法的参数
哦 谢谢提醒
re: EJB原理学习_RMIC G_G 2007-12-05 15:41  
在次感谢 ‘☆蓝蓝心情★’ 细心的帮助
@TonySoft
哦 是数据同步
开源数据同步框架!能说的具体点吗?
我先在知道的就只有EJB但好想不是开元等级的 !
代码 我一定在明天 给出
这就 献丑了
re: 测试 servlet(转) G_G 2007-11-16 15:37  
http://www.blogjava.net/Good-Game/archive/2007/11/02/157726.html

你看看这 个blog 这有对 setAttribute 的方法
你可以用
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

new File(
classLoader.get URL 什么方法名字不太记的了
);

写逻辑名就可以如你的:
/WebRoot/WEB-INF/web.xml
@李泳
不是怎么理解的你的io操作!不要写物理路径。
我告诉你一种方法
这通过Classload来加载 写逻辑路径 就没有这什么考虑的了
可以参考我blog里的介绍
http://www.blogjava.net/Good-Game/archive/2007/08/09/128154.html

中的 hbn 加载文件
re: dom4j 学习 G_G 2007-11-09 17:13  
@姜利阳
都是 jdk中xml的包装类 dom4j 和 jdom (我jdom没太看呵呵)
re: CGLib 学习 G_G 2007-11-09 17:11  
@雨奏
限制或副作用到没感觉到
但功能明显太单薄了
和aspectj没的比 切入表达式 的aspectj 和只可以硬编码的切CGlib
的功能用下就知道 CGlib 太简单了
但他好用,好上手,给5分钟就上了

aspectj 我花了2星期才到理解程度 呵呵
re: dom4j 学习 G_G 2007-11-06 17:59  
谢谢
(转)@抛出异常的爱 经典的说:
测试就是分解后的需求
。。。。。
如果需求变了找到这些测试修改之
。。。。。
需求变更的过程就是不停的修改测试用例的过程

如何写一个可用的测试?
1.一般例
2.特例
3.可能出现的特例但现在没有提出来的,不必写测试
4.不可能出现的特例 抛异常(就是你说的那两种卡)。

写测试之前要先把你说的图画出来
测试是文档化,可自动检查的图形。
用人的眼睛来比较图与代码的区别,
那是上世纪的活,这个世纪不用了。
re: cell报表学习(一) G_G 2007-10-26 09:42  
呵呵 我们公司也是用这个
用了一年了 呵呵
re: 魔鬼也觉得悲哀 G_G 2007-10-22 15:20  
*_*!
离我好近的地方啊

re: AOP 学习笔记 G_G 2007-10-18 18:16  
我会边学习边记录的
re: Google宕机了? G_G 2007-10-15 17:02  
我遇到 有许多次了
等 等
java 好象是 16 为是吧
那第一句的
int j1 = abyte0[l++] & 0xff;
只 给 后 面 8位与 前面的补0 也与
!@#$%
这怎么反 啊
等结果
呵呵 解码 G_G
这也被你整出来 !·#¥%……

仔细看了下
// 这好说 与 111.... 到时候 不变 到 j1
// 还真玩人
int j1 = abyte0[l++] & 0xff;

//k1 ,l1 得到 0 或 abyte0[l++]
int k1 = l >= i ? 0 : abyte0[l++] & 0xff;
int l1 = l >= i ? 0 : abyte0[l++] & 0xff;

// >>> ??什么东西 难道是 j1>> (>>2) ?
//>> 是 和 除 /2 有点同 1101 >> 0110 : 1
int i2 = j1 >>> 2;

// ....... (无语)
int j2 = (j1 & 3) << 4 | k1 >>> 4;
int k2 = (k1 & 0xf) << 2 | l1 >>> 6;
int l2 = l1 & 0x3f;
//静态块中定义的 cChar 定义的 什么 A..Z 9..0 a..z
ac[i1++] = cChar[i2];
ac[i1++] = cChar[j2];
// ..... 外头的 l1 还是 不好好一步一步走的 !·#¥%……
ac[i1] = i1 >= j ? '=' : cChar[k2];
i1++;
ac[i1] = i1 >= j ? '=' : cChar[l2];

看来 我 好好当代码工人把 (有点不干啊 )
re: hbn 笔记 G_G 2007-10-12 16:21  
Configuration ->
//方法 doConfigure 有 dom4j用法
protected Configuration doConfigure(org.dom4j.Document doc)
javascript 定义到 一个js中
后 几个jsp 共用 这个 js
呵呵
好实在的程序员啊
G_G
re: hbn 笔记 G_G 2007-10-10 10:57  

hbn 加载文件

 ConfigHelper.getResourceAsStream
public static InputStream getResourceAsStream(String resource) {
String stripped
= resource.startsWith("/") ?
resource.substring(
1) : resource;

InputStream stream
=null;
ClassLoader classLoader
= Thread.currentThread().getContextClassLoader();
if (classLoader!=null) {
stream
= classLoader.getResourceAsStream( stripped );
}
if ( stream ==null ) {
Environment.
class.getResourceAsStream( resource );
}
if ( stream ==null ) {
stream
= Environment.class.getClassLoader().getResourceAsStream( stripped );
}
if ( stream ==null ) {
thrownew HibernateException( resource +" not found" );
}
return stream;
}

re: hbn 笔记 G_G 2007-10-10 10:50  
源码分析
在 Factory中
private static final ThreadLocal threadLocal = new ThreadLocal();
的使用 可以参考
http://www.java3z.com/cwbwebhome/article/article2a/275.jsp?id=324

线程安全
Session session = (Session) threadLocal.get();
if (session == null) {
if (sessionFactory == null) {
try {
cfg.configure(CONFIG_FILE_LOCATION);
sessionFactory = cfg.buildSessionFactory();
}
catch (Exception e) {
System.err.println("%%%% Error Creating SessionFactory %%%%");
e.printStackTrace();
}
}
session = sessionFactory.openSession();
threadLocal.set(session);
}

return session;
re: 让 java 动态 G_G 2007-10-10 09:28  
@Unmi
谢谢提醒
我希望有人 和我一起把这个小东西 弄成个 开元框架
共2页: 1 2 下一页