- 博客(17)
- 资源 (5)
- 收藏
- 关注
转载 Jsp基础速成精解
Servlet三个要素: 1.必须继承自HttpServlet 2.必须实现doGet()或者doPost() 3.必须在web.xml中配置Servlet HttpServeltRrequest:请求对象 getParameter():获得表单元素的值 getAttribute():获得request范围中的属性值 setAttribute():设置reqeust范围中的
2008-03-30 18:45:00 864
原创 求三连循环语句频度
计算下列程序中x=x+1的语句频度for(i=1;i for(j=1;j for(k=1;k x=x+1; 【解答】x=x+1的语句频度为:T(n)=1+(1+2)+(1+2+3)+……+(1+2+……+n)=n(n+1)(n+2)/6 证明步骤:先看S(n)=1+2+3+……+n=n(n+1)/2=(n^2)/
2008-03-28 19:46:00 6017 3
转载 时间复杂度的计算
时间复杂度:算法中基本操作重复执行的次数是问题规模n的某个函数f(n),T(n)=O(f(n))。它表示随问题规模n的增大,算法执行时间的增长率和f(n)的增长率相同。 语句的频度:是该语句重复执行的次数。例1:交换i和j的内容。temp=i; i=j; j=temp;以上三条语句的频度均为1,该程序的执行时间是与问题规模n无关的常数,因此算法的时间复杂度为常数阶,记作T(n)=O(1)
2008-03-28 17:02:00 1293
转载 Synchronization (computer science)
In computer science, synchronization refers to one of two distinct, but related concepts: synchronization of processes, and synchronization of data. Process synchronization refers to the idea that mu
2008-03-27 16:13:00 624
转载 JAVA的容器---List,Map,Set
=======================================================¥¥¥¥¥¥¥¥卷首隔离带¥¥¥¥¥¥¥¥=======================================================Collection├List│├LinkedList│├ArrayList│└Vector│ └Stack└SetM
2008-03-26 20:26:00 3839
转载 Java中的正则表达式 包含embedded flags
JDK 1.4提供了内建的正则表达式支持,相应的,String类也提供了许多与正则表达式有关的方法,例如matches、replaceAll和split方法,为日常应用提供了许多便利。在工作中,我发现,掌握一些不常用的技巧,往往可以极大地提高效率,以下是我总结的一点经验:1.合理利用embedded flag。某些时候,我们会遇到这样的情况:要求匹配一个字符串,例如abcdefg,其中abc必须为
2008-03-25 20:51:00 1267
原创 数学价值1-叉乘法判断点是否在三角形内
叉乘法 沿着三角形的边按顺时针方向走,判断该点是否在每条边的右边(这可以通过叉乘判断),如果该点在每条边的右边,则在三角形内,否则在三角形外。这个算法只用到了三次叉乘,没有除法运算和三角函数、开根号等运算,所以效率很高,而且精度很高(没有浮点误差)。 设三角形三点A(x1,y1)B(x2,y2)C(x3,y3),已知点M(x,y), 1,先求出三个向量MA,MB,MC.
2008-03-25 16:55:00 9694 6
转载 深入研究servlet 实例,线程安全等方面问题
主要参考:深入研究Servlet线程安全性问题http://tech.163.com/05/0523/14/1KEML1JS00091589.htmlServlet的多线程机制 Servlet体系结构是建立在Java多线程机制之上的,它的生命周期是由Web容器负责的。当客户端第一次请求某个Servlet时,Servlet容器将会根据web.xml配置文件实例化这
2008-03-24 22:31:00 1063
转载 Timer和TimerTask详解
1.概览Timer是一种定时器工具,用来在一个后台线程计划执行指定任务。它可以计划执行一个任务一次或反复多次。TimerTask一个抽象类,它的子类代表一个可以被Timer计划的任务。简单的一个例程: import java.util.Timer;import java.util.TimerTask;/*** Simple demo
2008-03-21 11:37:00 593
转载 SpringAOP之HelloWorld
【IT168文档】我们使用一个简单的例子来演示一下Spring中的AOP,这是一个log的例子,实际上log是一个对于AOP来说很不好的例子,这里我们只为说明Spring AOP的使用。 1.首先我们来创建一个自己的interceptor 这个类必须继承org.aopalliance.intercept. MethodInterceptor接口。Spring的AOP框架就是参照aopal
2008-03-21 01:25:00 578
转载 XPath最通俗的教程
XPath最通俗的教程(ZZ) 以下是本人找到的最完整最易懂的XPath教程,不敢私藏,拿出来与大家分享。实例 1基本的XPath语法类似于在一个文件系统中定位文件,如果路径以斜线 / 开始, 那么该路径就表示到一个元素的绝对路径 /AAA
2008-03-20 20:36:00 720
转载 怎样安装和配置Tomcat Admin
怎样安装和配置Tomcat Administration Web ApplicationHow install and configure Tomcat Administration Web ApplicationYYJASON 原创,2006年7月22日Tomcat 5可以通过以运行在网页浏览器的配置应用程序非常方便地进行服务器的配置。这个应用程序称为Tomcat Administration
2008-03-19 13:52:00 648
转载 Generics in the Java Programming Language Java
Generics in the Java Programming LanguageJava编程语言中的泛型Gilad BrachaJuly 5, 2004Contents内容1 Introduction 介绍22 Defining Simple Generics定义简单泛型 33 Generics and Subtyping 泛型和子类型44 Wildcards 通
2008-03-17 22:12:00 3010
转载 Java中移位操作符的运算规则
关键字: Java数值计算 Java中的移位,如果是short,char,byte的话,都会转换成int的形式 再进行移位的。 试看: 1.) byte a = 27;// 转换成int为 0000000000
2008-03-17 14:15:00 882
转载 Java中的DEM事件机制
Java中的DEM事件机制 AWT中的DEM机制 责任链模式一章中曾谈到,AWT1.0的事件处理的模型是基于责任链的。这种模型不适用于复杂的系统,因此在AWT1.1版本及以后的各个版本中,事件处理模型均为基于观察者模式的委派事件模型(Delegation Event Model或DEM)。 在DEM模型里面,主题(Subject)角色负责发布(publish)事件,而观察者角色向特定的主题
2008-03-15 02:12:00 1231
转载 java模式之中介者模式
浅议Java设计模式的中介者模式 一、引子 中介在现实生活中并不陌生,满大街的房屋中介、良莠不齐的出国中介……。它们的存在是因为它们能给我们的生活带来一些便利:租房、买房用不着各个小区里瞎转;出国留学也不用不知所措。 中介者模式在程序设计中也起到了类似的作用。 二、定义与结构 GOF给中介者模式下的定义是:用一个中介对象来封装一系列的对象交互
2008-03-14 20:35:00 1153
转载 java模式之单例模式
java模式之单例模式: 单例模式确保一个类只有一个实例,自行提供这个实例并向整个系统提供这个实例。 特点: 1,一个类只能有一个实例 2,自己创建这个实例 3,整个系统都要使用这个实例 例: 在下面的对象图中,有一个"单例对象",而"客户甲"、"客户乙" 和"客户丙"是单例对象的三个客户对象。可以看到,所有的客户对象共享一个单例对象。而
2008-03-14 15:59:00 657
swing hacks
2010-08-16
After Hours: 10 Projects You'll Never Do at Work
2007-06-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人