我会走向何方

我又该走向何方

BlogJava 首页 新随笔 联系 聚合 管理
  15 Posts :: 2 Stories :: 17 Comments :: 0 Trackbacks

2009年3月30日 #

主要是java方面的开发,如果你知道python就更好,如果你是那种认为"什么语言都一样"就最好
当然,你如果听过jstl、spring、hibernate、lucence等opensource会更好
由于是处于创业期的团队,需要从前台照顾到后台,所以希望你的js也很出色,当然同样,你如果听过jquery、prototype、ext-js等opensource会更好


有兴趣的兄弟可以访问的网站 http://www.j.cn

可以直接简历发到我的邮箱 hama916@gmail.com

当然提供业界领先的待遇标准与晋升机会(落了俗套)

对了,欢迎北京本地实习生(外地就算了,提供不了宿舍),希望你的年轻、激情为我们的团队带来活力:-)
posted @ 2009-03-30 11:44 hama 阅读(87) | 评论 (0)编辑 收藏

2007年2月6日 #

How do I configure Tomcat to support remote debugging?

The short answer is to add the following options when the JVM is started:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
There are a number of ways you can do this depending on how you normally start Tomcat:

  • Set environment variables JPDA_ADDRESS=8000 and JPDA_TRANSPORT=dt_socket and then start tomcat using catalina jpda start(sh catalina.sh jpda start).
  • If you run Tomcat using service wrapper, check the documentation for the service to determine how to set the required JVM options.
  • If you start Tomcat from within an IDE, check the documentation for the IDE to determine how to set the required JVM options.

Using catalina start and CATALINA_OPTS

Alternatively, you can set the java program's command-line arguments for the JPDA settings. For Tomcat, you specify them in the CATALINA_OPTS environment variable and the catalina.sh or catalina.bat script adds the value of the environment variable to the java command that starts Tomcat; for example:

bash:

declare -x CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
$JWSDP_HOME/bin/catalina.sh start

csh:

setenv CATALINA_OPTS "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
$JWSDP_HOME/bin/catalina.sh start

Windows:

set JPDA_TRANSPORT=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
%JWSDP_HOME%\bin\catalina start
The port does not need to be set to 8000, it may be any value appropriate for your system.

Whilst this is very useful in development it should not be used in production because of both security and performance implications.


How do I remotely debug Tomcat using Eclipse?

This answer assumes that you have a project set up with all of the fixings and have some idea of what you're doing in this respect. If not then thats really outside the scope of this topic and more in the scope of you needing to go to eclipse.org and read up on how to use your ide, and maybe practice a little bit before you come back to this. We're also going to assume you have some idea of what a debugger is and how to use one.

Make sure tomcat is started and that your app is deployed and the sources, etc are all defined as resources in your app. If you have a servlet or something, set a breakpoint where its sure to hit on the next request. Go to "Run->Debug...". Click on "Remote Java Applications", then click "New". Type in the title and all. Notice that port 8000 from the Tomcat instructions. Save and run. Eclipse will connect to the VM that Tomcat is running under. Wow, that was easy! Now go type the url to submit to your servlet or whatever in your browser. Boom you hit the breakpoint right? Have fun!

posted @ 2007-02-06 09:02 hama 阅读(3086) | 评论 (0)编辑 收藏

2007年1月31日 #

由于公司的项目前期是给外包团队做的,接手的时候我们自己和外包团队都需要更新代码,但因为合同的问题,所以我们不能直接修改外包团队CVS上的代码, CVS的版本分支问题搞的头好大!
当然问题圆满解决!!!感谢车东!!!

CVS Branch:项目多分支同步开发

确认版本里程碑:多个文件各自版本号不一样,项目到一定阶段,可以给所有文件统一指定一个阶段里程碑版本号,方便以后按照这个阶段里程碑版本号导出项目,同时也是项目的多个分支开发的基础。

cvs tag release_1_0

开始一个新的里程碑
cvs commit -r 2 标记所有文件开始进入2.x的开发

注意:CVS里的revsion和软件包的发布版本可以没有直接的关系。但所有文件使用和发布版本一致的版本号比较有助于维护。

版本分支的建立
在开发项目的2.x版本的时候发现1.x有问题,但2.x又不敢用,则从先前标记的里程碑:release_1_0导出一个分支 release_1_0_patch
cvs rtag -b -r release_1_0 release_1_0_patch proj_dir

一些人先在另外一个目录下导出release_1_0_patch这个分支:解决1.0中的紧急问题,
cvs checkout -r release_1_0_patch
而其他人员仍旧在项目的主干分支2.x上开发

在release_1_0_patch上修正错误后,标记一个1.0的错误修正版本号
cvs tag release_1_0_patch_1

如果2.0认为这些错误修改在2.0里也需要,也可以在2.0的开发目录下合并release_1_0_patch_1中的修改到当前代码中:
cvs update -j release_1_0_patch_1


posted @ 2007-01-31 11:45 hama 阅读(1044) | 评论 (0)编辑 收藏

2007年1月30日 #


<script>
function f(m,n){
 var r = Math.round(Math.random()*(n-m))+m;
 alert(r);
}
f(0,23);
</script>

posted @ 2007-01-30 16:02 hama 阅读(180) | 评论 (0)编辑 收藏

2006年10月5日 #

     摘要: 将excel数据整理成sql语句   1 package  com.fangq.excel2sql;   2   3 import  java.io.BufferedReader;   4 ...  阅读全文
posted @ 2006-10-05 07:56 hama 阅读(1242) | 评论 (0)编辑 收藏

2006年8月31日 #

  “美国最好闭嘴并保持沉默!”

  8月17日,BBC(英国广播公司)的广播节目中,为反驳布什政府对中国军费开支增长的指责,中国常驻联合国日内瓦办事处及瑞士其他国际组织代表沙祖康大使出言直率

  “美国的军费占全球军费开支的一半,而中国的人口是美国的五六倍。为什么指责中国?”随后,沙祖康提高嗓音,“美国该如何做,这是美国的主权,但美国不应告诉中国该如何做!”

  在谈及台湾未来是否可能宣布“独立”时,沙祖康更是直言不讳:“台湾宣布‘独立’的那一刻,不管谁支持它,中国都将别无选择。……在这个问题上,任何人都不应该有任何幻想。我们将不惜一切代价。”

  沙祖康还补充道:“对于中国,一寸领土比生命更有价值。在这一点上,我们永远不会退缩。”

  这一系列大胆言论,让西方大跌眼镜,也让国人颇感意外。而惟有熟悉沙祖康的人知道,这是其一贯风格。

  “典型的现实主义外交”

  一向大胆敢言的沙祖康本来就不乏拥趸。随着BBC节目的播放,半个月来,“沙式语录”迅速风靡网上中文论坛和博客。让美国人“Shut up”的英文讲话录音甚至被网民剪辑出来,放到网上供人下载。

  为何沙祖康的这段发言受到网民如此追捧? 清华大学军控问题专家李彬教授评价说,“(沙祖康)说的是实话。”

  在个人风格上,这个农民出身、喜爱看武侠小说的外交官承认“不大相信外交辞令”,他也不讳言自己讲话粗,习惯有话都摆在桌面上谈。美国报纸对沙氏讲话风格的评论是“令人吃惊的坦率(surprisingly frank)”。在李彬看来,沙祖康的外交思路属于比较典型的现实主义,虽然他自己未必意识到。

  “现实主义的思路就是按照国家利益和实力来计算国家之间的互动。这样的思路简明、清晰,容易理解。沙祖康用此思路进行交流时,对方当然会感觉到‘坦率’。”

  李彬说,“此外,沙祖康负责军控外交的时期也是中国实质性参与国际军控的时期,国家投入的研究力度很大。在很多实质性军控问题上,中国必须表达明确的态度,而且也有对策研究基础做这样的表态。在开始阶段,外国人对这些坦率确实比较吃惊。”

posted @ 2006-08-31 22:26 hama 阅读(221) | 评论 (0)编辑 收藏

2006年8月26日 #

StudentDTO.java
package com.fangq.collections;
/**
 * 
 * 
@author fangq
 *
 
*/

public class StudentDTO {
    
private String xm;//姓名
    private String xh;//学号
    private String nl;//年龄
    public String getNl() {
        
return nl;
    }

    
public void setNl(String nl) {
        
this.nl = nl;
    }

    
public String getXh() {
        
return xh;
    }

    
public void setXh(String xh) {
        
this.xh = xh;
    }

    
public String getXm() {
        
return xm;
    }

    
public void setXm(String xm) {
        
this.xm = xm;
    }

    
}

StudentComparator.java
package com.fangq.collections;

import java.util.Comparator;
/**
 * 按dto的某个字段排序
 * 
@author fangq
 *
 
*/

public class StudentComparator implements Comparator{

    
public int compare(Object arg0, Object arg1) {
        
// TODO Auto-generated method stub
        if(arg0 instanceof StudentDTO&&arg1 instanceof StudentDTO){
            StudentDTO dto1 
= (StudentDTO)arg0;
            StudentDTO dto2 
=  (StudentDTO)arg1;
            
int nl1 = Integer.parseInt(dto1.getNl());
            
int nl2 = Integer.parseInt(dto2.getNl());
            
if(nl1<nl2)
                
return -1;
            
else if(nl1==nl2)
                
return 0;
            
else
                
return 1;
            
        }

        
return -1;
    }


    

}

TestComparator.java
package com.fangq.collections;

import java.util.Arrays;

import org.apache.commons.lang.math.RandomUtils;
/**
 *
 * @author fangq
 */
public class TestComparator {
 public static void main(String[] args){
  StudentDTO[] dtos = new StudentDTO[10];
  for(int i=0;i<dtos.length;i++){
   dtos[i] = new StudentDTO();
   dtos[i].setXh("xh"+i);
   dtos[i].setXm("xm"+i);
   dtos[i].setNl(String.valueOf(i+RandomUtils.nextInt(20)));
  }
  System.out.println("排序前===============");
  for(int j=0;j<dtos.length;j++)
  System.out.println("姓名:"+dtos[j].getXm()+"年龄:"+dtos[j].getNl());
  
  Arrays.sort(dtos,new StudentComparator());
  System.out.println("排序后===============");
  for(int k=0;k<dtos.length;k++)
  System.out.println("姓名:"+dtos[k].getXm()+"年龄:"+dtos[k].getNl());
  
 }
}

posted @ 2006-08-26 16:10 hama 阅读(1407) | 评论 (0)编辑 收藏

 

package  com.fangq.collections;
/**
 * 后进先出
 * 自动扩容2倍
 * 
@author  new
 *
 
*/

public   class  Stack  {
    
private  Object[] stack;
    
private   int  max;
    
private   int  top;
    
public  Stack() {
        stack 
=   new  Object[ 20 ];
        max 
=   20 ;
        top 
=   - 1 ;
    }

    
public  Stack( int  s) {
        stack 
=   new  Object[s];
        max 
=  s;
        top
=- 1 ;
    }

    
public   void  push(Object o)  throws  Exception {
        
if (o == null )
            
throw   new  Exception( " 不允许空值 " );
        top
++ ;
        
if (top > max - 1 ) {
            System.out.println(
" 开始扩容 " );
            max 
=  max * 2 ;
            Object[] oldStack 
=  stack;
            Object[] newStack 
=    new  Object[max];
            System.arraycopy(oldStack,
0 ,newStack, 0 ,top);
            stack 
=  newStack;
        }

        System.out.println(
" top=====> " + top);
        System.out.println(
" max=====> " + max);
        stack[top] 
=  o; 
    }

    
public  Object pop() {
        
return  stack[top -- ];
    }

    
public   static   void  main(String[] args) {
        Stack s 
=    new  Stack( 10 );
        
try {
            
for ( int  i = 1 ;i < 22 ;i ++ ) {
                s.push(String.valueOf(i));
            }

            System.out.println(s.pop());
            System.out.println(s.pop());
        }
catch (Exception e) {
            e.printStackTrace();
        }

    }

}

posted @ 2006-08-26 09:35 hama 阅读(213) | 评论 (0)编辑 收藏

2006年7月24日 #

今天在看jdk源码的时候发现居然有个
@author  Li Gong
一看就是个中国人,后来上网一搜     宫力
Li Gong自从JXTA项目正式启动,到2001年4月正式发布,到2001年6月JavaOne上的介绍就一直担任JXTA项目的工程指导及首席设计师。此前,在JDK 1.1和1.2版本的开发期间,他主管着Java安全和网络小组。他在清华大学获得了学士和硕士学位,从剑桥大学获得了博士学位。他是IEEE Internet Computing和ACM TISSEC的编委会成员,也在IEEE S&P、IEEE CSFW和ACM CCS担任要职。他拥有6项美国专利,已经撰写了60篇技术论文和2本书,并且于1994年获得了IEEE通信组织颁发的Leonard G. Abraham奖。目前,他在北京担任Sun公司的中国工程研究所的总经理。
posted @ 2006-07-24 22:33 hama 阅读(2183) | 评论 (6)编辑 收藏

2006年7月23日 #

jvm随着应用程序(java application)而生而灭,当一个application开始时,jvm的生命就开始了,当application结束时,jvm的生命也结束了。在一台机器上同时运行多个application时会生成多个jvm实例!

java Test

该命令的java,告诉操作系统开始运行java虚拟机,Test 必须有main方法,是该application线程的起点,其他所有线程都由这个初始线程启动

在java虚拟机内部有两种线程:一种是守护线程,一种非守护线程。守护线程通常是虚拟机自己使用的,比如执行垃圾收集的线程。当然java也可以把创建的线程标记为守护线程

而由main开始的线程就是一个非守护线程,只要还有任何非守护线程运行,java虚拟机就任然存活,当application中的所有非守护线程都结束时,java虚拟机也会自动退出,假若安全管理器允许,程序也可以通过调用Runtime或System的exit()方法来退出虚拟机实例jvm.JPG
posted @ 2006-07-23 18:59 hama 阅读(727) | 评论 (0)编辑 收藏

仅列出标题  下一页