Terry hug's

——whole life

2009年6月19日



	//锐角三角函数公式

   sin α=∠α的对边 / 斜边

   cos α=∠α的邻边 / 斜边

   tan α=∠α的对边 / ∠α的邻边

   cot α=∠α的邻边 / ∠α的对边
倍角公式   Sin2A=2SinA?CosA   Cos2A=CosA^2-SinA^2=1-2SinA^2=2CosA^2-1   tan2A=(2tanA)/(1-tanA^2)   (注:SinA^2 是sinA的平方 sin2(A) ) 三倍角公式   sin3α=4sinα·sin(π/3+α)sin(π/3-α)   cos3α=4cosα·cos(π/3+α)cos(π/3-α)   tan3a = tan a · tan(π/3+a)· tan(π/3-a) 三倍角公式推导   sin3a   =sin(2a+a)   =sin2acosa+cos2asina 辅助角公式   Asinα+Bcosα=(A^2+B^2)^(1/2)sin(α+t),其中   sint=B/(A^2+B^2)^(1/2)   cost=A/(A^2+B^2)^(1/2)   tant=B/A   Asinα+Bcosα=(A^2+B^2)^(1/2)cos(α-t),tant=A/B 降幂公式   sin^2(α)=(1-cos(2α))/2=versin(2α)/2   cos^2(α)=(1+cos(2α))/2=covers(2α)/2   tan^2(α)=(1-cos(2α))/(1+cos(2α)) 推导公式   tanα+cotα=2/sin2α   tanα-cotα=-2cot2α   1+cos2α=2cos^2α   1-cos2α=2sin^2α   1+sinα=(sinα/2+cosα/2)^2   =2sina(1-sin²a)+(1-2sin²a)sina   =3sina-4sin³a   cos3a   =cos(2a+a)   =cos2acosa-sin2asina   =(2cos²a-1)cosa-2(1-sin²a)cosa   =4cos³a-3cosa   sin3a=3sina-4sin³a   =4sina(3/4-sin²a)   =4sina[(√3/2)²-sin²a]   =4sina(sin²60°-sin²a)   =4sina(sin60°+sina)(sin60°-sina)   =4sina*2sin[(60+a)/2]cos[(60°-a)/2]*2sin[(60°-a)/2]cos[(60°-a)/2]   =4sinasin(60°+a)sin(60°-a)   cos3a=4cos³a-3cosa   =4cosa(cos²a-3/4)   =4cosa[cos²a-(√3/2)²]   =4cosa(cos²a-cos²30°)   =4cosa(cosa+cos30°)(cosa-cos30°)   =4cosa*2cos[(a+30°)/2]cos[(a-30°)/2]*{-2sin[(a+30°)/2]sin[(a-30°)/2]}   =-4cosasin(a+30°)sin(a-30°)   =-4cosasin[90°-(60°-a)]sin[-90°+(60°+a)]   =-4cosacos(60°-a)[-cos(60°+a)]   =4cosacos(60°-a)cos(60°+a)   上述两式相比可得   tan3a=tanatan(60°-a)tan(60°+a) 半角公式   tan(A/2)=(1-cosA)/sinA=sinA/(1+cosA);   cot(A/2)=sinA/(1-cosA)=(1+cosA)/sinA.   sin^2(a/2)=(1-cos(a))/2   cos^2(a/2)=(1+cos(a))/2   tan(a/2)=(1-cos(a))/sin(a)=sin(a)/(1+cos(a)) 三角和   sin(α+β+γ)=sinα·cosβ·cosγ+cosα·sinβ·cosγ+cosα·cosβ·sinγ-sinα·sinβ·sinγ   cos(α+β+γ)=cosα·cosβ·cosγ-cosα·sinβ·sinγ-sinα·cosβ·sinγ-sinα·sinβ·cosγ   tan(α+β+γ)=(tanα+tanβ+tanγ-tanα·tanβ·tanγ)/(1-tanα·tanβ-tanβ·tanγ-tanγ·tanα) 两角和差   cos(α+β)=cosα·cosβ-sinα·sinβ   cos(α-β)=cosα·cosβ+sinα·sinβ   sin(α±β)=sinα·cosβ±cosα·sinβ   tan(α+β)=(tanα+tanβ)/(1-tanα·tanβ)   tan(α-β)=(tanα-tanβ)/(1+tanα·tanβ) 和差化积   sinθ+sinφ = 2 sin[(θ+φ)/2] cos[(θ-φ)/2]   sinθ-sinφ = 2 cos[(θ+φ)/2] sin[(θ-φ)/2]   cosθ+cosφ = 2 cos[(θ+φ)/2] cos[(θ-φ)/2]   cosθ-cosφ = -2 sin[(θ+φ)/2] sin[(θ-φ)/2]   tanA+tanB=sin(A+B)/cosAcosB=tan(A+B)(1-tanAtanB)   tanA-tanB=sin(A-B)/cosAcosB=tan(A-B)(1+tanAtanB) 积化和差   sinαsinβ = [cos(α-β)-cos(α+β)] /2   cosαcosβ = [cos(α+β)+cos(α-β)]/2   sinαcosβ = [sin(α+β)+sin(α-β)]/2   cosαsinβ = [sin(α+β)-sin(α-β)]/2 诱导公式   sin(-α) = -sinα   cos(-α) = cosα   tan (—a)=-tanα   sin(π/2-α) = cosα   cos(π/2-α) = sinα   sin(π/2+α) = cosα   cos(π/2+α) = -sinα   sin(π-α) = sinα   cos(π-α) = -cosα   sin(π+α) = -sinα   cos(π+α) = -cosα   tanA= sinA/cosA   tan(π/2+α)=-cotα   tan(π/2-α)=cotα   tan(π-α)=-tanα   tan(π+α)=tanα   诱导公式记背诀窍:奇变偶不变,符号看象限 万能公式   sinα=2tan(α/2)/[1+tan^(α/2)]   cosα=[1-tan^(α/2)]/1+tan^(α/2)]   tanα=2tan(α/2)/[1-tan^(α/2)] 其它公式   (1)(sinα)^2+(cosα)^2=1   (2)1+(tanα)^2=(secα)^2   (3)1+(cotα)^2=(cscα)^2   证明下面两式,只需将一式,左右同除(sinα)^2,第二个除(cosα)^2即可   (4)对于任意非直角三角形,总有   tanA+tanB+tanC=tanAtanBtanC   证:   A+B=π-C   tan(A+B)=tan(π-C)   (tanA+tanB)/(1-tanAtanB)=(tanπ-tanC)/(1+tanπtanC)   整理可得   tanA+tanB+tanC=tanAtanBtanC   得证   同样可以得证,当x+y+z=nπ(n∈Z)时,该关系式也成立   由tanA+tanB+tanC=tanAtanBtanC可得出以下结论   (5)cotAcotB+cotAcotC+cotBcotC=1   (6)cot(A/2)+cot(B/2)+cot(C/2)=cot(A/2)cot(B/2)cot(C/2)   (7)(cosA)^2+(cosB)^2+(cosC)^2=1-2cosAcosBcosC   (8)(sinA)^2+(sinB)^2+(sinC)^2=2+2cosAcosBcosC   (9)sinα+sin(α+2π/n)+sin(α+2π*2/n)+sin(α+2π*3/n)+……+sin[α+2π*(n-1)/n]=0   cosα+cos(α+2π/n)+cos(α+2π*2/n)+cos(α+2π*3/n)+……+cos[α+2π*(n-1)/n]=0 以及   sin^2(α)+sin^2(α-2π/3)+sin^2(α+2π/3)=3/2   tanAtanBtan(A+B)+tanA+tanB-tan(A+B)=0
posted @ 2013-08-14 16:34 [terry hug] 阅读(170) | 评论 (0)编辑 收藏
一.JVM内存的设置的原理 默认的java虚拟机的大小比较小,在对大数据进行处理时java就会报错:java.lang.OutOfMemoryError。设置jvm内存的方法,对于单独的.class,可以用下面的方法对Test运行时的jvm内存进行设置。
java -Xms64m -Xmx256m Test
-Xms是设置内存初始化的大小 -Xmx是设置最大能够使用内存的大小(最好不要超过物理内存大小) 在weblogic中,可以在startweblogic.cmd中对每个domain虚拟内存的大小进行设置,默认的设置是在commEnv.cmd里面。
-vmargs 
-Xms128M
-Xmx512M 
-XX:PermSize=64M 
-XX:MaxPermSize=128M
下面是这几个设置的一些背景知识: 堆(Heap)和非堆(Non-heap)内存

按照官方的说法:“Java 虚拟机具有一个堆,堆是运行时数据区域,所有类实例和数组的内存均从此处分配。堆是在 Java 虚拟机启动时创建的。”“在JVM中堆之外的内存称为非堆内存(Non-heap memory)”。可以看出JVM主要管理两种类型的内存:堆和非堆。简单来说堆就是Java代码可及的内存,是留给开发人员使用的;非堆就是JVM留给 自己用的,所以方法区、JVM内部处理或优化所需的内存(如JIT编译后的代码缓存)、每个类结构(如运行时常数池、字段和方法数据)以及方法和构造方法 的代码都在非堆内存中。 堆内存分配

JVM初始分配的内存由-Xms指定,默认是物理内存的1/64;JVM最 大分配的内存由-Xmx指定,默认是物理内存的1/4。默认空余堆内存小于40%时,JVM就会增大堆直到-Xmx的最大限制;空余堆内存大于70%时, JVM会减少堆直到-Xms的最小限制。因此服务器一般设置-Xms、-Xmx相等以避免在每次GC 后调整堆的大小。 非堆内存分配

JVM使用-XX:PermSize设置非堆内存初始值,默认是物理内存的1/64;由XX:MaxPermSize设置最大非堆内存的大小,默认是物理内存的1/4。 JVM内存限制(最大值)

首先JVM内存首先受限于实际的最大物理内存,假设物理内存无限 大的话,JVM内存的最大值跟操作系统有很大的关系。简单的说就32位处理器虽然可控内存空间有4GB,但是具体的操作系统会给一个限制,这个限制一般是 2GB-3GB(一般来说Windows系统下为1.5G-2G,Linux系统下为2G-3G),而64bit以上的处理器就不会有限制了 JVM内存的调优

1. Heap设定与垃圾回收

Java Heap分为3个区,Young,Old和Permanent。Young保存刚实例化的对象。当该区被填满时,GC会将对象移到Old区。Permanent区则负责保存反射对象,本文不讨论该区。JVM的Heap分配可以使用-X参数设定,

  • -Xms 初始Heap大小
  • -Xmx java heap最大值
  • -Xmn young generation的heap大小

JVM有2个GC线程。第一个线程负责回收Heap的Young区。第二个线程在Heap不足时,遍历Heap,将Young 区升级为Older区。Older区的大小等于-Xmx减去-Xmn,不能将-Xms的值设的过大,因为第二个线程被迫运行会降低JVM的性能。

为什么一些程序频繁发生GC?有如下原因:
  • 程序内调用了System.gc()或Runtime.gc()
  • 一些中间件软件调用自己的GC方法,此时需要设置参数禁止这些GC
  • Java的Heap太小,一般默认的Heap值都很小
  • 频繁实例化对象,Release对象。此时尽量保存并重用对象,例如使用StringBuffer()和String()

如果你发现每次GC后,Heap的剩余空间会是总空间的50%,这表示你的Heap处于健康状态。许多Server端的Java程序每次GC后最好能有65%的剩余空间。经验之谈:

  1. Server端JVM最好将-Xms和-Xmx设为相同值。为了优化GC,最好让-Xmn值约等于-Xmx的1/3
  2. 一个GUI程序最好是每10到20秒间运行一次GC,每次在半秒之内完成

注意:

  1. 增加Heap的大小虽然会降低GC的频率,但也增加了每次GC的时间。并且GC运行时,所有的用户线程将暂停,也就是GC期间,Java应用程序不做任何工作
  2. Heap大小并不决定进程的内存使用量。进程的内存使用量要大于-Xmx定义的值,因为Java为其他任务分配内存,例如每个线程的Stack等

2.Stack的设定

每个线程都有他自己的Stack。

-Xss 每个线程的Stack大小

Stack的大小限制着线程的数量。如果Stack过大就好导致内存溢漏。-Xss参数决定Stack大小,例如-Xss1024K。如果Stack太小,也会导致Stack溢漏。

3.硬件环境</p>

硬件环境也影响GC的效率,例如机器的种类,内存,swap空间,和CPU的数量。

如果你的程序需要频繁创建很多transient对象,会导致JVM频繁GC。这种情况你可以增加机器的内存,来减少Swap空间的使用[2]。

4.4种GC

第一种为单线程GC,也是默认的GC。,该GC适用于单CPU机器。

第二种为Throughput GC,是多线程的GC,适用于多CPU,使用大量线程的程序。第二种GC与第一种GC相似,不同在于GC在收集Young区是多线程的,但在Old区和第一种一样,仍然采用单线程。-XX:+UseParallelGC参数启动该GC。

第三种为Concurrent Low Pause GC,类似于第一种,适用于多CPU,并要求缩短因GC造成程序停滞的时间。这种GC可以在Old区的回收同时,运行应用程序。-XX:+UseConcMarkSweepGC参数启动该GC。

第四种为Incremental Low Pause GC,适用于要求缩短因GC造成程序停滞的时间。这种GC可以在Young区回收的同时,回收一部分Old区对象。-Xincgc参数启动该GC。

4种GC的具体描述参见[3]。

参考文章:

1. JVM Tuning. http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp#garbage-collection

2. Performance tuning Java: Tuning steps

3. Tuning Garbage Collection with the 1.4.2 JavaTM Virtual Machine . http://java.sun.com/docs/hotspot/gc1.4.2/

二.Tomcat配置

问题分析:

   由于TOMCAT内存溢出而引发的问题,主要原因是JVM的虚拟内存默认为128M,当超过这个值时就把先前占用的内存释放,而导致好象TCP/IP丢包的假象,出现HTTP500的错误。解决方法主要是加大TOMCAT可利用内存,并在程序当中加大内存使用。

解决方法:

方法:加大TOMCAT可利用内存:

  

在TOMCAT的目录下,也就是在TOMCAT41/bin/catalina.bat文件最前面加入

  
set JAVA_OPTS=-Xms800m -Xmx800m
  

表现效果是当你启动TOMCAT时,系统内存会增加近800M使用

操作方法:

  1. 先关掉WINDOWS服务当中的TOMCAT4服务
  2. 再找到TOMCAT/BIN目录下startup.bat,双击打开它,你会发现现WINDOWS内存占用会增加近800M
  3. 执行程序,因为是TOMCAT重新编译程序,所以第一次会比较慢

结论:

经过测试,我们得出如下数据:

当系统传输约2000条数据时,大约近12M的净数据(不压缩时),系统辅助运行的内存大约占用150M左右的空间,也就是近200M的内存占用,而我们扩大了近800M的JAVA内存使用,这对于业务本身来说是足够了。所以你们不用担心大数据量的传递问题。

基于JAVA虚拟机的原理,JAVA自动有垃圾回收机制,也就是在你对一些内存长时间不使用时(近2分钟,取决于使用频度和优先级等),就会自动垃圾回收,从而释放不用的内存占用。

三.WebLogic配置:

由于WebLogic的配置问题,我们的测试出现了失败情况。原因是为WebLogic分配的内存太少了。通过修改commom\bin\commEnv.cmd文件来增加内存分配。

修改的部分如下:

:bea

if "%PRODUCTION_MODE%" == "true" goto bea_prod_mode

set JAVA_VM=-jrockit

set MEM_ARGS=-Xms768m -Xmx1024m

set JAVA_OPTIONS=%JAVA_OPTIONS% -Xverify:none

goto continue

:bea_prod_mode

set JAVA_VM=-jrockit

set MEM_ARGS=-Xms768m -Xmx1024m//原来是128M~256M,太小了,数据太大

goto continue

结果修改后,没有效果。还是有失败的情况。

发现,原来,在:bea下面还有一段配置信息如下:

:sun

if "%PRODUCTION_MODE%" == "true" goto sun_prod_mode

set JAVA_VM=-client

set MEM_ARGS=-Xms768m -Xmx1024m -XX:MaxPermSize=256m

set JAVA_OPTIONS=%JAVA_OPTIONS% -Xverify:none

goto continue

:sun_prod_mode

set JAVA_VM=-server

set MEM_ARGS=-Xms768m -Xmx1024m -XX:MaxPermSize=256m

goto continue

将这里的内存分配修改后见效。

原因是,上面对第一段代码是为bea自己的JVM设置的,下面的是为Sun的设置的。而WebLogic默认的是Sun的,所以出了毛病。在JDK的选择上,weblogic有两种JDK供选择,一种是Sun的JDK,另外一种是Bea的jrockit。按照bea的网站的说明,sun jdk提供更好的兼容性,而使用jrockit可以提供更好的性能。作为weblogic集群我全部采用jrockit作为JDK环境,以达到更高的性能。

在默认启动情况下,jrockit启动时为其窗口配置的内存大小比较小。注意weblogic的启动内存配置-Xms32m -Xmx256m,通过修改commEnv.sh可以修改这个参数,Xms表示启动开始分配的内存,Xmx表示最大能分配的内存,这里我们根据应用情况调整为-Xms1536m -Xmx1536m,这点需要根据自身测试情况和系统配置进行调整,经过周一晚的调试,我们目前应用比较合理的窗口内存大小为1536M(2G× 75%),通过top可以观察到测试中的内存反应,最合理的应该是恰好把物理内存用完。

posted @ 2013-04-08 01:00 [terry hug] 阅读(289) | 评论 (0)编辑 收藏
先说说什么是Modernizr:

Modernizr 是一套 JavaScript 函式库,用来侦测浏览器是否支援次世代的网站技术。

Modernizr不同于传统透过解析浏览器的用户代理的识辨方式,认为这种方式亦不可靠,例如使用者可以手动更改它们浏览器的User agent、即便是相同的网页渲染引擎,在不同的浏览器中也不一定支援相同的功能。因此Modernizr通常会建立一个特定样式的元素,然后立刻尝试改写这些元素的设定,若在支援的浏览器上,元素会回传有意义的值。但在不支援的浏览器则会回传空值或“undefined”。Modernizr 利用这些结果来判断浏览器是否支援这些功能。

Modernizr能测试超过100种以上的次世代功能。测试的结果会储存在一个名为“Modernizr”的物件里,里面包含了测试结果的布林值。并且根据支援或不支援的功能,新增class名称给HTML元素。
                                                                 --摘自《维基百科》
以前,html+css很难写出符合各种浏览器标准的代码,为了保证兼容性,对不同的浏览器运行不同的样式,html开发人员必须使用各种hacks,利用浏览器的漏洞来使不同的浏览器加载不同的css样式。此种解决方法只能说是便宜之计,而Modernizr提供了比较优雅的解决方案。

先看看怎么使用吧:


<html class="no-js">
	<head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

     <title>test</title>
        
         <script src="js/modernizr.js" type="text/javascript"></script>
         
    </head>

    <body>
      <h1>test</h1>
    </body>
</html>

这里在运行的时候会被取代为:(用firebug之类的工具可以看到实际加载的类)

<html class=" js flexbox canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop no-websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity no-cssanimations csscolumns cssgradients no-cssreflections csstransforms no-csstransforms3d csstransitions fontface generatedcontent video audio localstorage no-sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths">
可以看到所有以“no-”开头的,就是这个浏览器不支持的特性。因此,只要在css种添加两种样式:
.canvas h1 {
    color: blue;
  }

.no-canvas h1 {
    color: red;
  }
由于html元素被添加了相应的class,使得两种样式在不同的情况下被加载了。 也可以使用javascript判断一个名为Modernizr的元素属性:
$(function() {
    if (Modernizr.canvas) {
      $('h1').text('canvas');
    } else {
      $('h1').text('no-canvas');
    }
  });
也可以使用Modernizr.load()来加载:
// Give Modernizr.load a string, an object, or an array of strings and objects
Modernizr.load([
  // Presentational polyfills
  {
    // Logical list of things we would normally need
    test : Modernizr.fontface && Modernizr.canvas && Modernizr.cssgradients,
    // Modernizr.load loads css and javascript by default
    nope : ['presentational-polyfill.js', 'presentational.css']
  },
  // Functional polyfills
  {
    // This just has to be truthy
    test : Modernizr.websockets && window.JSON,
    // socket-io.js and json2.js
    nope : 'functional-polyfills.js',
    // You can also give arrays of resources to load.
    both : [ 'app.js', 'extra.js' ],
    complete : function () {
      // Run this after everything in this group has downloaded
      // and executed, as well everything in all previous groups
      myApp.init();
    }
  },
  // Run your analytics after you've already kicked off all the rest
  // of your app.
  'post-analytics.js'
]);
具体参考http://modernizr.com/docs/
posted @ 2013-03-29 23:06 [terry hug] 阅读(1584) | 评论 (1)编辑 收藏
    final在Java中并不常用,然而它却为我们提供了诸如在C语言中定义常量的功能,不仅如此,final还可以让你控制你的成员、方法或者是一个类是否可被覆写或继承等功能,这些特点使final在Java中拥有了一个不可或缺的地位,也是学习Java时必须要知道和掌握的关键字之一。
final成员
  当你在类中定义变量时,在其前面加上final关键字,那便是说,这个变量一旦被初始化便不可改变,这里不可改变的意思对基本类型来说是其值不可变,而对于对象变量来说其引用不可再变。其初始化可以在两个地方,一是其定义处,也就是说在final变量定义时直接给其赋值,二是在构造函数中。这两个地方只能选其一,要么在定义时给值,要么在构造函数中给值,不能同时既在定义时给了值,又在构造函数中给另外的值。下面这段代码演示了这一点:
import java.util.List;
import java.util.ArrayList;
import java.util.LinkedList;
public class Bat{
    final PI=3.14;          //在定义时便给址值
    final int i;            //因为要在构造函数中进行初始化,所以此处便不可再给值
    final List list;        //此变量也与上面的一样
    Bat(){
        i=100;
        list=new LinkedList();
    }
    Bat(int ii,List l){
        i=ii;
        list=l;
    }
    public static void main(String[] args){
        Bat b=new Bat();
        b.list.add(new Bat());
        //b.i=25;
        //b.list=new ArrayList();
        System.out.println("I="+b.i+" List Type:"+b.list.getClass());
        b=new Bat(23,new ArrayList());
        b.list.add(new Bat());
        System.out.println("I="+b.i+" List Type:"+b.list.getClass());
    }
}
    此程序很简单的演示了final的常规用法。在这里使用在构造函数中进行初始化的方法,这使你有了一点灵活性。如Bat的两个重载构造函数所示,第一个缺省构造函数会为你提供默认的值,重载的那个构造函数会根据你所提供的值或类型为final变量初始化。然而有时你并不需要这种灵活性,你只需要在定义时便给定其值并永不变化,这时就不要再用这种方法。在main方法中有两行语句注释掉了,如果你去掉注释,程序便无法通过编译,这便是说,不论是i的值或是list的类型,一旦初始化,确实无法再更改。然而b可以通过重新初始化来指定i的值或list的类型,输出结果中显示了这一点:

I=100 List Type:class java.util.LinkedList
I=23 List Type:class java.util.ArrayList
  还有一种用法是定义方法中的参数为final,对于基本类型的变量,这样做并没有什么实际意义,因为基本类型的变量在调用方法时是传值的,也就是说你可以在方法中更改这个参数变量而不会影响到调用语句,然而对于对象变量,却显得很实用,因为对象变量在传递时是传递其引用,这样你在方法中对对象变量的修改也会影响到调用语句中的对象变量,当你在方法中不需要改变作为参数的对象变量时,明确使用final进行声明,会防止你无意的修改而影响到调用方法。 另外方法中的内部类在用到方法中的参变量时,此参变也必须声明为final才可使用,如下代码所示:
public class INClass{
   void innerClass(final String str){
        class IClass{
            IClass(){
                System.out.println(str);
            }
        }
        IClass ic=new IClass();
    }
  public static void main(String[] args){
      INClass inc=new INClass();
      inc.innerClass("Hello");
  }
}
final方法
  将方法声明为final,那就说明你已经知道这个方法提供的功能已经满足你要求,不需要进行扩展,并且也不允许任何从此类继承的类来覆写这个方法,但是继承仍然可以继承这个方法,也就是说可以直接使用。另外有一种被称为inline的机制,它会使你在调用final方法时,直接将方法主体插入到调用处,而不是进行例行的方法调用,例如保存断点,压栈等,这样可能会使你的程序效率有所提高,然而当你的方法主体非常庞大时,或你在多处调用此方法,那么你的调用主体代码便会迅速膨胀,可能反而会影响效率,所以你要慎用final进行方法定义。
final类
  当你将final用于类身上时,你就需要仔细考虑,因为一个final类是无法被任何人继承的,那也就意味着此类在一个继承树中是一个叶子类,并且此类的设计已被认为很完美而不需要进行修改或扩展。对于final类中的成员,你可以定义其为final,也可以不是final。而对于方法,由于所属类为final的关系,自然也就成了final型的。你也可以明确的给final类中的方法加上一个final,但这显然没有意义。
  下面的程序演示了final方法和final类的用法:
final class final{
    final String str="final Data";
    public String str1="non final data";
    final public void print(){
        System.out.println("final method.");
    }
    public void what(){
        System.out.println(str+"\n"+str1);
    }
}
public class FinalDemo {   //extends final 无法继承 
    public static void main(String[] args){
        final f=new final();
        f.what();
        f.print();
    }
}
  从程序中可以看出,final类与普通类的使用几乎没有差别,只是它失去了被继承的特性。final方法与非final方法的区别也很难从程序行看出,只是记住慎用。
posted @ 2013-03-25 16:40 [terry hug] 阅读(211) | 评论 (0)编辑 收藏

静态和非静态内部类的对比代码:

package com.test.xml;
/**
* @author <a href="mailto:dq201@126.com">du.qiang</a>
* @version $Revision 1.1 $ 2010-6-23 上午06:48:28
*/
public class OutClassTest {
static int a;
int b;
public static void test() {
System.out.println("outer class static function");
}
public static void main(String[] args) {
OutClassTest oc = new OutClassTest();
// new一个外部类
OutClassTest oc1 = new OutClassTest();
// 通过外部类的对象new一个非静态的内部类
OutClassTest.InnerClass no_static_inner = oc1.new InnerClass();
// 调用非静态内部类的方法
System.out.println(no_static_inner.getKey());
// 调用静态内部类的静态变量
System.out.println(OutClassTest.InnerStaticClass.static_value);
// 不依赖于外部类实例,直接实例化内部静态类
OutClassTest.InnerStaticClass inner = new OutClassTest.InnerStaticClass();
// 调用静态内部类的非静态方法
System.out.println(inner.getValue());
// 调用内部静态类的静态方法
System.out.println(OutClassTest.InnerStaticClass.getMessage());
}
private class InnerClass {
// 只有在静态内部类中才能够声明或定义静态成员
// private static String tt = "0";
private int flag = 0;
public InnerClass() {
// 三.非静态内部类的非静态成员可以访问外部类的非静态变量和静态变量
System.out.println("InnerClass create a:" + a);
System.out.println("InnerClass create b:" + b);
System.out.println("InnerClass create flag:" + flag);
//
System.out.println("InnerClass call outer static function");
// 调用外部类的静态方法
test();
}
public String getKey() {
return "no-static-inner";
}
}
private static class InnerStaticClass {
// 静态内部类可以有静态成员,而非静态内部类则不能有静态成员。
private static String static_value = "0";
private int flag = 0;
public InnerStaticClass() {
System.out.println("InnerClass create a:" + a);
// 静态内部类不能够访问外部类的非静态成员
// System.out.println("InnerClass create b:" + b);
System.out.println("InnerStaticClass flag is " + flag);
System.out.println("InnerStaticClass tt is " + static_value);
}
public int getValue() {
// 静态内部类访问外部类的静态方法
test();
return 1;
}
public static String getMessage() {
return "static-inner";
}
}
public OutClassTest() {
// new一个非静态的内部类
InnerClass ic = new InnerClass();
System.out.println("OuterClass create");
}
}

 

/** 
* 总结:
* 1.静态内部类可以有静态成员(方法,属性),而非静态内部类则不能有静态成员(方法,属性)。
* 2.静态内部类只能够访问外部类的静态成员,而非静态内部类则可以访问外部类的所有成员(方法,属性)。
* 3.实例化一个非静态的内部类的方法:
* a.先生成一个外部类对象实例
* OutClassTest oc1 = new OutClassTest();
* b.通过外部类的对象实例生成内部类对象
* OutClassTest.InnerClass no_static_inner = oc1.new InnerClass();
* 4.实例化一个静态内部类的方法:
* a.不依赖于外部类的实例,直接实例化内部类对象
* OutClassTest.InnerStaticClass inner = new OutClassTest.InnerStaticClass();
* b.调用内部静态类的方法或静态变量,通过类名直接调用
* OutClassTest.InnerStaticClass.static_value
* OutClassTest.InnerStaticClass.getMessage()
*/
posted @ 2013-03-24 23:53 [terry hug] 阅读(378) | 评论 (0)编辑 收藏

jsp开发中路径可以用一下几种方法解决,可以找到运行时的资源:

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
    <title>My JSP 'index.jsp' starting page</title>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->
  </head>
 
  <body>
    This is my JSP page. <br>
  </body>
</html>

posted @ 2009-11-25 14:32 [terry hug] 阅读(135) | 评论 (0)编辑 收藏
public void widgetSelected(SelectionEvent selectionevent) {

if (selectionevent.widget.equals(button)) {

showProgressBar();
setBarValue(
60);

final String eValue = e.getText();
final String fValue = f.getText();

new Thread(new Runnable() {

public void run() {
// TODO Auto-generated method stub
                    try {
byte[] resultData = null;
byte[] authorizeData = factory.CreateAuthorizeData(eValue, fValue);
ConnectionServiceThread.sendToAuthServer(authorizeData);

display.asyncExec(
new Runnable() {public void run() {setBarValue(50);}});//设置进度条进度
                        
resultData 
= ConnectionServiceThread.recevieFromAuthServer();
final SessionBean result = factory.HandleSessionData(resultData);

if(result.getStates() == Constants.LOGIN_SUCESSFUL){
//登陆成功
                            display.asyncExec(new Runnable() {public void run() {display.setData(Constants.SESSION_ID_KEY, result.getSessionId());}});
new MainIndex();


}
else{
//登陆失败
                            display.asyncExec(new Runnable() {public void run() {label.setText("用户名或密码错误,请重试");}});

}

display.asyncExec(
new Runnable() {public void run() {setBarValue(100);}});

catch (IOException e1) {

// 处理网络异常
                        display.asyncExec(new Runnable() {public void run() {label.setText("数据访问错误");}});

}
catch(SecurityException e2){

display.asyncExec(
new Runnable() {public void run() {label.setText("未被允许访问网络");}});

finally {
display.asyncExec(
new Runnable() {public void run() {closeProgressBar();}});//关进度条
                    }

}

}).start();

}
}

    最近在弄SWT,界面是其实是单线程的。不能有任何阻塞,事务在异步的时候也只能新建线程来处理,但是此线程有不能修改任何界面相关的数据。于是出现了上面大量的重复代码。不知道这样处理对不?

posted @ 2009-08-17 17:35 [terry hug] 阅读(289) | 评论 (0)编辑 收藏
GridLayout是一个非常强大的布局管理器,它可以实现很多复杂的布局,名字中暗示它将所有控件放置在类似网格的布局中.^__^GridLayout有两个构造函数. 

GridLayout的构造函数 
构造函数描述 
public GridLayout()建立一个默认的GridLayout布局. 
public GridLayout(int numColumns, boolean makeColumnsEqualWidth)建立一个GridLayout布局,拥有numColumns列,如果makeColumnsEqualWidth为true,则全部组件将拥有相同的宽度. 
GridLayout有6个公共的数据成员,相对重要的是numColumns. 

GridLayout数据成员 
属性描述 
int horizontalSpacing控制一行中两个网格间组件的宽度,像素为单位. 
boolean makeColumnsEqualWidth如果为true,强制全部的列拥有相同的宽度. 
int marginHeight控制顶部和底部组件离边缘的距离空间,以像素为单位. 
int marginWidth控制左边和右边组件离边缘的距离空间,以像素为单位. 
int numColumns此GridLayout的列数目. 
int verticalSpacing控制一列中两个网络间组件的宽度,像素为单位. 
你能使用GridLayout设置GridData类来布局更多的复杂组件.GridData有两个构造函数. 

GridData构造函数 
构造函数描述 
public GridData()创建默认一个默认的GridData对象. 
public GridData(int style)初始化指定的style风格布局. 
和其它的布局类一样,GridLayout也提供一些公共的数据成员控制它的状态,它也提供一些常量,你可以在在构造成函数中使用.你可以用过位标志"|"来连接几个不同的效果,但请注意风格不要起冲突. 

GridData数据成员 
属性描述 
boolean grabExcessHorizontalSpace如果为true,指示布局器中网格自动填充多余的水平空间,默认为false. 
boolean grabExcessVerticalSpace如果为true,指示布局器中网格自动填写多余的垂直空间,默认为false. 
int heightHint该行中最小的高度,以像素为单位,默认为SWT.DEFAULT. 
int horizontalAlignment网格中组件水平对齐方式,可能的值为BEGINNING, CENTER, END,和FILL. 
int horizontalIndent与左边网格的水平缩进,默认为0 
int horizontalSpan设置网格占有的列数目,默认为1 
int verticalAlignment网格中组件垂直对齐方式,可能的值为BEGINNING, CENTER, END,和FILL. 
int verticalSpan设置网格占有的行数目,默认为1 
int widthHint该列中最小的宽度,以像素为单位,默认为SWT.DEFAULT. 

GridData常量 
常量描述 
BEGINNING非style值,指定水平或垂直的对齐方式. 
CENTER非style值,指定组件在网格中居中,水平或垂直. 
END非style值,指定水平或垂直的对齐方式. 
FILL非style值,指定组件填充网格,水平或垂直. 
FILL_BOTH设置horizontalAlignment和verticalAlignment为FILL,设置grabExcessHorizontalSpace和grabExcessVerticalSpace为true. 
FILL_HORIZONTAL设置horizontalAlignment为FILL,和设置grabExcessHorizontalSpace为true. 
FILL_VERTICAL设置verticalAlignment为FILL,和设置grabExcessVerticalSpace为true. 
GRAB_HORIZONTAL设置grabExcessHorizontalSpace为true. 
GRAB_VERTICAL设置grabExcessVerticalSpace为true. 
HORIZONTAL_ALIGN_BEGINNING设置horizontalAlignment为BEGINNING. 
HORIZONTAL_ALIGN_CENTER设置horizontalAlignment为CENTER. 
HORIZONTAL_ALIGN_END设置horizontalAlignment为END. 
HORIZONTAL_ALIGN_FILL设置horizontalAlignment为FILL. 
VERTICAL_ALIGN_BEGINNING设置verticalAlignment为BEGINNING. 
VERTICAL_ALIGN_CENTER设置verticalAlignment为CENTER. 
VERTICAL_ALIGN_END设置verticalAlignment为END. 
VERTICAL_ALIGN_FILL设置verticalAlignment为FILL. 

下面我们来看几个例子: 
代码片段: 

GridLayout gridLayout = new GridLayout(); 
gridLayout.numColumns = 2; 
shell.setLayout(gridLayout); 

new Button(shell, SWT.PUSH).setText("one"); 
new Button(shell, SWT.PUSH).setText("two"); 
new Button(shell, SWT.PUSH).setText("three"); 
new Button(shell, SWT.PUSH).setText("four");运行效果: 


图中可以看到各个Button的宽度是依靠字体长度来自动设定的,假如你想设置所有的Button都使用相同的大小该怎么办?使用makeColumnsEqualWidth = true;吗?不,这样做不行,它回会将各网格的大小设为相同,我们该使用GridData中相关属性来设置Button.下面程序中使用了GridData.FILL_BOTH属性,它将填充所在网格水平或垂直空间,并将多余空间占有,这样不论窗口调整多大,四个Button都会有相同空间. 
当然GridLayout能做的不只是这些,要更复杂的效果,可能多个Composite配合使用,具体请参见原书第二部分第四章:Apress.The.Definitive.Guide.to.SWT.and.JFace.eBook-LiB.chm 
运行效果 
初始化: 

调整大小后: 

完整代码: 
package chapter4; 

import org.eclipse.swt.SWT; 
import org.eclipse.swt.layout.GridData; 
import org.eclipse.swt.layout.GridLayout; 
import org.eclipse.swt.widgets.Button; 
import org.eclipse.swt.widgets.Display; 
import org.eclipse.swt.widgets.Shell; 

/**//** 
* @author HexUzHoNG Created on 2005-6-23 

*/ 
public class GridLayoutDemo { 

public static void main(String[] args) { 

Display display = new Display(); 
Shell shell = new Shell(display); 

GridLayout gridLayout = new GridLayout(); 
//设置为2列 
gridLayout.numColumns = 2; 
gridLayout.makeColumnsEqualWidth = true; 
shell.setLayout(gridLayout); 

GridData gd = new GridData(GridData.FILL_BOTH); 
Button butOne = new Button(shell, SWT.PUSH); 
butOne.setText("one"); 
butOne.setLayoutData(gd); 

gd = new GridData(GridData.FILL_BOTH); 
Button butTwo = new Button(shell, SWT.PUSH); 
butTwo.setText("two"); 
butTwo.setLayoutData(gd); 

gd = new GridData(GridData.FILL_BOTH); 
Button butThree = new Button(shell, SWT.PUSH); 
butThree.setText("three"); 
butThree.setLayoutData(gd); 

gd = new GridData(GridData.FILL_BOTH); 
Button butFour = new Button(shell, SWT.PUSH); 
butFour.setText("four"); 
butFour.setLayoutData(gd); 

shell.pack(); 
shell.open(); 

while (!shell.isDisposed()) { 
if (!display.readAndDispatch()) { 
display.sleep(); 



display.dispose(); 


}

posted @ 2009-07-20 14:12 [terry hug] 阅读(1992) | 评论 (0)编辑 收藏
和SIP有关的RFC: 

RFC 2543 SIP: Session Initiation Protocol
RFC 2848 The PINT Service Protocol: Extensions to SIP and SDP for IP Access to Telephone Call Services
RFC 2976 The SIP INFO Method
RFC 3050 Common Gateway Interface for SIP
RFC 3087 Control of Service Context using SIP Request-URI.
RFC 3261 SIP: Session Initiation Protocol
RFC 3262 Reliability of Provisional Responses in the SIP
RFC 3263 Session Initiation Protocol (SIP): Locating SIP Servers
RFC 3265 Session Initiation Protocol (SIP)-Specific Event Notification
RFC 3311 The Session Initiation Protocol (SIP) UPDATE Method
RFC 3312 Integration of Resource Management and SIP 
RFC 3313 Private SIP Extensions for Media Authorization 
RFC 3319 DHCPv6 Options for SIP Servers 
RFC 3323 A Privacy Mechanism for the Session Initiation Protocol (SIP)
RFC 3325 Private Extensions to SIP for Asserted Identity within Trusted Networks 
RFC 3326 The Reason Header Field for the Session Initiation Protocol (SIP)
RFC 3327 SIP Extension Header Field for Registering Non-Adjacent Contacts 
RFC 3329 Security Mechanism Agreement for SIP
RFC 3351 User Requirements for the SIP in Support of Deaf, Hard of Hearing and Speech-impaired Individuals
RFC 3361 DHCP-for-IPv4 Option for SIP Servers
RFC 3372 SIP for Telephones (SIP-T): Context and Architectures 
RFC 3398 ISUP to SIP Mapping 
RFC 3420 Internet Media Type message/sipfrag
RFC 3427 Change Process for the SIP
RFC 3428 Session Initiation Protocol (SIP) Extension for Instant Messaging
RFC 3455 Private Header (P-Header) Extensions to the SIP for the 3GPP
RFC 3485 The SIP and SDP Static Dictionary for Signaling Compression
RFC 3486 Compressing the Session Initiation Protocol (SIP)
RFC 3487 Requirements for Resource Priority Mechanisms for the SIP.
RFC 3515 The Session Initiation Protocol (SIP) Refer Method 
RFC 3578 Mapping of Integrated Services Digital Network (ISDN) User Part (ISUP) Overlap Signalling to the SIP
RFC 3581 An Extension to the SIP for Symmetric Response Routing
RFC 3603 Private SIP Proxy-to-Proxy Extensions for Supporting the PacketCable Distributed Call Signaling Architecture.
RFC 3608 SIP Extension Header Field for Service Route Discovery During Registration
RFC 3665 Session Initiation Protocol (SIP) Basic Call Flow Examples
RFC 3666 SIP Public Switched Telephone Network (PSTN) Call Flows. 
RFC 3680 SIP Event Package for Registrations
RFC 3702 Authentication, Authorization, and Accounting Requirements for the SIP
RFC 3725 Best Current Practices for Third Party Call Control (3pcc) n the Session Initiation Protocol (SIP)
RFC 3764 Enumservice registration for Session Initiation Protocol (SIP)
RFC 3824 Using E.164 numbers with the Session Initiation Protocol (SIP).
RFC 3840 Indicating User Agent Capabilities in SIP
RFC 3841 Caller Preferences for SIP 
RFC 3842 A Message Summary and Message Waiting Indication Event Package for SIP
RFC 3853 S/MIME Advanced Encryption Standard (AES) Requirement for the SIP
RFC 3856 A Presence Event Package for the Session Initiation Protocol (SIP)
RFC 3857 A Watcher Information Event Template-Package for the SIP
RFC 3891 The Session Initiation Protocol (SIP) "Replaces" Header
RFC 3892 The Session Initiation Protocol (SIP) Referred-By Mechanism
RFC 3893 Session Initiation Protocol (SIP) Authenticated Identity Body (AIB) Format
RFC 3903 Session Initiation Protocol (SIP) Extension for Event State Publication
RFC 3911 The Session Initiation Protocol (SIP) "Join" Header
RFC 3959 The Early Session Disposition Type for SIP
RFC 3960 Early Media and Ringing Tone Generation in SIP
RFC 3968 The Internet Assigned Number Authority (IANA) Header Field Parameter Registry for the SIP
RFC 3969 The Internet Assigned Number Authority (IANA) URI Parameter Registry for the SIP
RFC 3976 Interworking SIP and Intelligent Network (IN) Applications
RFC 4028 Session Timers in the Session Initiation Protocol (SIP)
RFC 4032 Update to the Session Initiation Protocol (SIP) Preconditions Framework
RFC 4083 Input 3GPP Release 5 Requirements on the SIP
RFC 4092 Usage of the SDP Alternative Network Address Types (ANAT) Semantics in the SIP
RFC 4117 Transcoding Services Invocation in the SIP Using Third Party Call Control (3pcc)
RFC 4123 Session Initiation Protocol (SIP)-H.323 Interworking Requirements
RFC 4168 The Stream Control Transmission Protocol (SCTP) as a Transport for the SIP
RFC 4189 Requirements for End-to-Middle Security for the SIP
RFC 4235 An INVITE-Initiated Dialog Event Package for the SIP
RFC 4240 Basic Network Media Services with SIP
RFC 4244 An Extension to the SIP for Request History Information
RFC 4245 High-Level Requirements for Tightly Coupled SIP Conferencing
RFC 4320 Actions Addressing Identified Issues with the SIP's Non-INVITE Transaction
RFC 4321 Problems Identified Associated with the SIP's Non-INVITE Transaction
RFC 4353 A Framework for Conferencing with the SIP.
RFC 4354 A SIP Event Package and Data Format for Various Settings in Support for the Push-to-Talk over Cellular (PoC) Service
RFC 4411 Extending the SIP Reason Header for Preemption Events
RFC 4412 Communications Resource Priority for the SIP
RFC 4453 Requirements for Consent-Based Communications in the SIP
RFC 4457 The SIP P-User-Database Private-Header (P-Header)
RFC 4458 SIP URIs for Applications such as Voicemail and Interactive Voice Response (IVR)
RFC 4474 Enhancements for Authenticated Identity Management in the SIP
RFC 4475 Session Initiation Protocol (SIP) Torture Test Messages.
RFC 4483 A Mechanism for Content Indirection in SIP
RFC 4484 Trait-Based Authorization Requirements for the SIP
RFC 4485 Guidelines for Authors of Extensions to the SIP
RFC 4488 Suppression of SIP REFER Method Implicit Subscription
RFC 4497 Interworking between the SIP and QSIG
RFC 4504 SIP Telephony Device Requirements and Configuration
RFC 4508 Conveying Feature Tags with the SIP REFER Method
RFC 4538 Request Authorization through Dialog Identification in the SIP
RFC 4575 A SIP Event Package for Conference State
RFC 4579 SIP Call Control - Conferencing for User Agents
RFC 4596 Guidelines for Usage of the SIP Caller Preferences Extension
RFC 4662 A SIP Event Notification Extension for Resource Lists
RFC 4730 A SIP Event Package for Key Press Stimulus (KPML).
RFC 4740 Diameter Session Initiation Protocol (SIP) Application. 


和SDP有关的RFC:
RFC 2327 SDP: Session Description Protocol
RFC 3108 Conventions for the use of the SDP for ATM Bearer Connections. 
RFC 3264 An Offer/Answer Model with the Session Description Protocol (SDP)
RFC 3266 Support for IPv6 in Session Description Protocol (SDP)
RFC 3388 Grouping Media Lines in SDP
RFC 3407 Session Description Protocol (SDP) Simple Capability Declaration
RFC 3556 Session Description Protocol (SDP) Bandwidth Modifiers for RTCP Bandwidth
RFC 3605 Real Time Control Protocol (RTCP) attribute in SDP
RFC 3890 A Transport Independent Bandwidth Modifier for the SDP
RFC 4091 The Alternative Network Address Types (ANAT) Semantics for the SDP Grouping Framework
RFC 4145 TCP-Based Media Transport in the Session Description Protocol (SDP)
RFC 4317 Session Description Protocol (SDP) Offer/Answer Examples
RFC 4566 SDP: Session Description Protocol. 
RFC 4567 Key Management Extensions for SDP and Real Time Streaming Protocol (RTSP)
RFC 4568 Session Description Protocol (SDP) Security Descriptions for Media Streams
RFC 4570 Session Description Protocol (SDP) Source Filters
RFC 4572 Connection-Oriented Media Transport over the TLS Protocol in the SDP
RFC 4574 The Session Description Protocol (SDP) Label Attribute
RFC 4583 SDP Format for Binary Floor Control Protocol (BFCP) Streams.
RFC 4796 The Session Description Protocol (SDP) Content Attribute


和Presence, IM有关的RFC:

RFC 2778 A Model for Presence and Instant Messaging
RFC 3858 An Extensible Markup Language (XML) Based Format for Watcher Information
RFC 3859 Common Profile for Presence (CPP)
RFC 3860 Common Profile for Instant Messaging (CPIM)
RFC 3863 Presence Information Data Format (PIDF)
RFC 4119 A Presence-based GEOPRIV Location Object Format
RFC 4479 A Data Model for Presence
RFC 4480 RPID: Rich Presence Extensions to the PIDF
RFC 4660 Functional Description of Event Notification Filtering 
RFC 4661 An XML-Based Format for Event Notification Filtering
RFC 4745 Common Policy: A Document Format for Expressing Privacy Preferences

XPIDF Draft: A Data Format for Presence Using XML (XPIDF)
XCAP Draft: The XML Configuration Access Protocol (XCAP)
Resource Lists Draft: The XML Formats for Representing Resource Lists
Presence Authorization Draft: Presence Authorization Rules
Partial Publication Draft: Publication of Partial Presence Information
Partial Presence Format Draft: PIDF Extension for Partial Presence
Partial Notification Draft: SIP extension for Partial Notification of Presence Information
OMA-defined PIDF extensions: OMA-defined PIDF extensions
SIMPLE: SIP for Instant Messaging and Presence Leveraging Extensions (simple)
Sipping-config-framework: A Framework for SIP User Agent Profile Delivery


其它:
RFC 2246 The TLS Protocol
RFC 2616 Hypertext Transfer Protocol -- HTTP/1.1 
RFC 2617 HTTP Authentication: Basic and Digest Access Authentication
RFC 2782 A DNS RR for specifying the location of services (DNS SRV)
RFC 2806 URLs for Telephone Calls
RFC 3310 HTTP Digest Authentication Using Authentication and Key Agreement (AKA) 
RFC 3489 STUN - Simple Traversal of UDP Through Network Address Translators (NATs)

posted @ 2009-06-19 12:41 [terry hug] 阅读(1148) | 评论 (2)编辑 收藏

公告

Locations of visitors to this page

导航

<2009年6月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿

随笔分类

随笔档案

文章档案

相册

收藏夹

友情链接

搜索

最新评论

阅读排行榜

评论排行榜