- 浏览: 178993 次
- 性别:
- 来自: 苏州
最新评论
-
jiasky:
好像是在练书法。
Oracle Function -
blackangel_can:
这样的代码见得多了。
Javascript Print(*) -
tianhendi:
Apache Solr and Tomcat6 Search engine -
laserdance:
我想问下,你怎么从Tomcat等服务器中把上述文件xml准确定 ...
Java parse XML methods(4) -
cskysnew:
第二种如果去掉synchronized,就不是线程安全的,应该 ...
Singlton ture or not?
文章列表
NIO:内存映射,文件锁,字符集编码和解码以及非阻塞I/O.
NIO的读写是Unicode的,无论是什么编码的,都是以Unicode的形式存储.
IO中的读写是二进制的读写.
IO用在网络通信一般是阻塞式通信.
NIO则是非阻塞式的,性能比IO提高了很多.
NIO比IO速度快。
- 2007-07-03 22:21
- 浏览 1154
- 评论(0)
True
public class Singleton {
private Singleton(){}
private static Singleton instance = new Singleton();
public static Singleton getInstance() {
return instance;
}
}
public class Singleton {
private static Singleton instance = null;
public static synchronized ...
Class.forName(xxx.xx.xx) 返回的是一个类
首先你要明白在java里面任何class都要装载在虚拟机上才能运行。这句话就是装载类用的(和new 不一样,要分清楚)。
至于什么时候用,你可以考虑一下这个问题,给你一个字符串变量,它代表一个类的包名和类名,你怎么实例化它?只有你提到的这个方法了,不过要再加一点。
A a = (A)Class.forName("pacage.A").newInstance();
这和你
A a = new A();
是一样的效果。
关于补充的问题
答案是肯定的,jvm会执行静态代码段,你要记住一个概念,静态 ...
- 2007-07-01 16:28
- 浏览 1099
- 评论(0)
Spring中的Callback模式与Template模式合用,随处可见。Template method被广泛的使用,像Servlet就是使用这个模式。Template mothod模式虽然能简化很多重复的代码,但这种模式的也有不少限制。Template mothod将一个功能的实现分成许多小的步骤,在父类中定义了这些步骤的顺序,让子类来具体实现每一个小的步骤。这些小的步骤是protected,以防止用户不正确的使用这些小的步骤而产生异常。这样就产生了一个限制,那就是你需要继承Template然后重新实现具体的小步骤。如果这个Template有许多方法,就像JdbcTemplate,如果你每次继 ...
- 2007-06-30 16:16
- 浏览 978
- 评论(0)
Django integrated to mod_python
1.download django-0.9.6
2.uncompress then run: python setup.py install
3.Add the python/Scripts to env path
4.Add the .py to the PATHEXE
So far,you can set up a project.
Steps:
1.create a directory in c:/mysite
2.django-admin.py startproject mysite
Setup an application ...
- 2007-06-14 17:23
- 浏览 1578
- 评论(0)
Prerequsitation:
1.Apache v2.2.4
2.Python2.4
3.mod_python3.3.1 for apache2.2 and python2.4
Configure Steps:
1.Add below in the apache/conf/http.conf(first check the mod_python.so whether exists in apache/modelus)
LoadModule python_module modules/mod_python.so
2.Configure the http.conf,add below(Co ...
- 2007-06-14 12:48
- 浏览 2282
- 评论(0)
GRANT ALL PRIVILEGES ON *.* TO aaron@localhost IDENTIFIED BY 'xxxxxx' WITH GRANT OPTION;
- 2007-06-08 21:22
- 浏览 2654
- 评论(0)
Mysqli supply with many new features for the php programming,also it's an OOP.
The below example can show you some: databind
$mysqli = new mysqli('localhost', 'aaron', 'xxxxxx', 'amo');
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_e ...
- 2007-06-08 16:32
- 浏览 1470
- 评论(0)
When use iframe embedded in the main page,maybe you want to access/set the content for some nodes in the iframe.
So you try to touch the page in iframe,the attachment will help you much more.
- 2007-05-15 22:52
- 浏览 1319
- 评论(0)
Write a web template by using struts associated with ajax.
The path and libs in the project list and requirement:
- 2007-05-15 22:28
- 浏览 1103
- 评论(0)
package com.spring;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
//import org.springframework.beans.factory.BeanFactory;
//import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.s ...
- 2007-05-15 22:16
- 浏览 2886
- 评论(0)
ftp://202.96.64.144/pub/books/
- 2007-05-15 21:06
- 浏览 830
- 评论(0)
escape():
The escape method returns a string value (in Unicode format) that contains the contents of [the argument]. All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the chara ...
- 2007-05-15 21:05
- 浏览 2527
- 评论(0)
SQL>CREATE OR REPLACE PROCEDURE PrintMSG_Aaron(
p_sys_code IN test.SYS_CODE%TYPE) AS
CURSOR c_msg IS
SELECT MSG_CODE,SYS_CODE FROM test WHERE SYS_CODE=p_sys_code AND
ROWNUM<10;
BEGIN
FOR v_sys_recoder IN c_msg LOOP
DBMS_OUTPUT.PUT_LINE(v_sys_recoder.MSG_CODE || ' ' || ...
- 2007-05-14 11:16
- 浏览 1007
- 评论(0)
1. Download and install py2exe from the py2exe website
(make sure you download the right version!)
2. Create a directory on you hardisk called mycode ... - Right click on the Windows Desktop and select New .. Folder and name it "mycode"
3. Double click the mycode folder to open it
4. Righ ...
- 2007-05-11 13:36
- 浏览 1629
- 评论(0)