- 浏览: 19859 次
- 性别:
- 来自: 苏州
最新评论
文章列表
**apt-get(来自:http://wiki.ubuntu.org.cn/Apt-get%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97)apt-get update——在修改/etc/apt/sources.list或者/etc/apt/preferences之後运行该命令。此外您需要定期运行这一命令以确保您的软件包列表是最新的。apt-get insta ...
- 2009-08-04 18:12
- 浏览 314
- 评论(0)
添加用户:
[root@localhost ~]# useradd test[root@localhost ~]# passwd testChanging password for user test.New UNIX password:
Retype new UNIX password: passwd: all authentication tokens updated successfully.此时,该用户才是可以使用的。
设置的默认规则如下:[root@localhost ~]# useradd -DGROUP=100HOME=/homeINACTIVE=-1EXPIRE=SH ...
- 2009-07-31 11:30
- 浏览 175
- 评论(0)
在javascript中操作textarea时如果要换行,需要加上换行符/n,但当要删除一行时却无法找到"/n”的匹配,原因就是换行符应该是"/r/n",加上这个就可以匹配了。
例如:
function tempFunc(object){var temp = document.getElementById("temp").value;var clip = document.getElementById("clip_ip");if(temp!=""){if(object){if(clip.value.in ...
- 2009-07-24 21:48
- 浏览 209
- 评论(0)
//提取查找字符串前面所有的字符function getFront(mainStr,searchStr){ foundOffset=mainStr.indexOf(searchStr); if(foundOffset==-1){ return null; } return mainStr.substring(0,foundOffset);}//提取查找字符串后面的所有字符function getEnd(mainStr,searchStr){ foundOffset=mainStr.indexOf(searchStr); if(foundOffset==-1){ return null; } re ...
- 2009-07-24 21:44
- 浏览 571
- 评论(0)
package com.netqin.data.weather;
import java.util.Iterator;import java.util.LinkedHashMap;import java.util.Map;import java.util.Set;
public class CharacterToPinyin {
/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubSystem.out.println(getFullSpell(" ...
- 2009-07-24 21:25
- 浏览 258
- 评论(0)
public static boolean checkDate(String date) {String eL = "^((//d{2}(([02468][048])|([13579][26]))[//-/////s]?((((0?[13578])|(1[02]))[//-/////s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[//-/////s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[//-/////s]?((0?[1-9])|([1-2][0-9])))))|(//d{2}(([0 ...
- 2009-07-24 21:02
- 浏览 620
- 评论(0)
原文之地:http://blog.csdn.net/Nicolas_Yang/archive/2008/12/12/3504480.aspx
【JAVA 中执行Shell】
jShell.java
/* * jShell.java * class jShell is used for executing shell command * USAGE: * jShell obj=new jShell(shellCommand); * obj.startErr(); * obj.startOut(); * obj.startIn(); * You can Interupt I/O thr ...
- 2009-07-21 21:39
- 浏览 379
- 评论(0)
原文地址:http://www.ibm.com/developerworks/cn/java/j-lo-spring25-mvc/index.html
使用 Spring 2.5 基于注解驱动的 Spring MVC
基于注解的配置有越来越流行的趋势,Spring 2.5 顺应这种趋势,为 Spring MVC 提供了完全基于注解的配置。本文将介绍 Spring 2.5 新增的 Sping MVC 注解功能,讲述如何使用注解配置替换传统的基于 XML 的 Spring MVC 配置。
继 Spring 2.0 对 Spring MVC 进行重大升级后,Spr ...
- 2009-07-21 21:21
- 浏览 267
- 评论(0)
1. 使用Spring注解来注入属性 1.1. 使用注解以前我们是怎样注入属性的 类的实现:
Java代码
publicclassUserManagerImplimplementsUserManager{
privateUserDaouserDao;
publicvoidsetUserDao(UserDaouserDao){
this.userDao=userDao;
}
...
- 2009-07-21 21:13
- 浏览 238
- 评论(0)
1.java.util.Date to java.sql.Date
java.sql.Date sqlDate = new java.sql.Date(new java.util.Date().getTime());
2.java.sql.Date to java.util.Date
java.sql.Date sqlDate = ……;
java.util.Date utilDate = new java.util.Date(sqlDate.getTime());
3.java.util.Date to java.sql.Timestamp
java.s ...
- 2009-07-21 10:57
- 浏览 285
- 评论(0)
1.String to InputStream
String str = "String与InputStream相互转换";
InputStream in_nocode = new ByteArrayInputStream(str.getBytes()); InputStream in_withcode = new ByteArrayInputStream(str.getBytes("UTF-8"));
2.InputStream to String
这里提供几个方法。
方法1:
publicStringconve ...
- 2009-07-20 18:48
- 浏览 216
- 评论(0)
如果希望从ServerA免输入passwd ssh到ServerB,先在ServerA上执行:
ssh-keygen -t rsa
例如:连续回车即可
hanqf@localhost:~$
- 2009-07-20 18:35
- 浏览 210
- 评论(0)
最近在开发一项目时使用了spring注解式事务管理,现介绍如下:
一.spring配置文件
这里使用spring命名空间,如下:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.spr ...
- 2009-07-18 14:59
- 浏览 283
- 评论(0)
spring对jdbc操控LOB也提供了简单的方式,以oracle数据库为例,方式如下:
一.spring配置文件
<!-- 提供对lob字段的支持 --><bean id="nativeJdbcExtractor"class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"lazy-init="true" />
<bean id="oracleLobHandler" c ...
- 2009-07-18 14:11
- 浏览 155
- 评论(0)
spring为hibernate提供了对LOB对像的支持,以oracle数据库为例,配置方法如下:
一.spring配置文件
<!-- 使用jndi连接数据库 --><!--<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"><property name="jndiName"><value>java:comp/env/develop</value></prope ...
- 2009-07-18 12:35
- 浏览 272
- 评论(0)