weiqiuhong 的个人资料我的地盤照片日志列表 工具 帮助

red weiqiuhong

职业
地点
兴趣
地球上的最後一個淑女
列表

我的地盤

Don't hurt me
4月17日

MSN的断层2008

  很长时间没有上MSN的博客了,建了一个又一个的blog,但又被我一个又一个的丢弃。。今天回头看自己以前写的文字,有种漠然回首的错觉,就像迟暮的老人看着年轻人,心里感叹我也曾经年轻过一样,而我的blog中年现在确是一片空白,不能连灌起来。。使我竟有一丝悔意,想去弥补一样,这才有了这篇文字。。

 2008年对于中国来说,要被历史记录的东西太多,三一四,五一二,以及零八零八。。。(先去做事,回来再续)

11月9日

用java在不同操作系统下安装PERL组件

需求:用JAVA语言实现WINDOW和LINUX系统下自动安装PERL组件的功能。
 public void execNormalInstall(String modulename) {
        Runtime runTime = Runtime.getRuntime();
        Process process = null;
        try {
            if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") >= 0) {
                modulename = modulename.replaceAll("::", "-");
                String path = CorePlugin.getDefault().getPreferenceStore().getString(ITalendCorePrefConstants.PERL_INTERPRETER);//安装PERL的目录 ex:E:\Perl\bin
                path = path.substring(0, path.lastIndexOf("\\"));
                process = runTime.exec("cmd /c start /D" + path + "\\" + " ppm install " + modulename);
              // process = runTime.exec("cmd /c start /D" + path + "\\" + " /B ppm install " + modulename);// "/B"不打开DOS窗口
            } else if (System.getProperty("os.name").toUpperCase().indexOf("LINUX") >= 0) {
                String command = "perl -MCPAN -e 'install " + modulename + "'";
                openTerminal(command, process);
            }
        } catch (Exception e) {
            MessageBoxExceptionHandler.process(e);
        }
    }
  public static void openTerminal(String command, Process process) {
        String terminal = System.getenv("TERM");
        try {
            process = Runtime.getRuntime().exec(new String[] { terminal, "-e", command + "; $SHELL" });
            process.waitFor();
        } catch (IOException e) {
            System.out.println(e.getMessage());
        } catch (InterruptedException e) {
            // TODO: handle exception
        }
当然如果是linux,需要安装gcc的编译器,之前不懂PERL,也没用过LINUX,浪费好几天,在LINUX下还有个权限问题。
7月17日

regular expression

   因为要改一个关于正规检验的BUG,所以有幸学习了下正规表达式的语法。在网上看了很多资料,越看越糊涂,直到找到下面这个网址:http://www.blogjava.net/xuechen0721/archive/2007/01/01/91320.html
  很不幸的是,虽然明白了正规表达式的语法,但是哪个BUG直到我写这个网志时,还被我设为“suspend”。具体情况如下:
 
7月13日

获取主目录以及子目录下某一类型的文件

   两种方法,一种采用递归:
1.
public class FileListExample {
 
 public static void main(String[] args) {
     
  String directory= "C:/TDDOWNLOAD";
  
      firstMethod(directory);
 }
 public static void firstMethod(String dir)
 {
  String directory=dir;
        String filemask       = "*.txt"+"$";
        String currentFilePath="";
        filemask = java.util.regex.Pattern.compile("[*]").matcher(filemask).replaceAll(".*");
        boolean case_sensitive = true;//大小写敏感
  java.util.regex.Pattern fileNamePattern = java.util.regex.Pattern.compile(filemask);
  if(!case_sensitive){
         fileNamePattern = java.util.regex.Pattern.compile(filemask, java.util.regex.Pattern.CASE_INSENSITIVE);
  }      
   java.io.File file=new java.io.File(directory);
        java.io.File[] files= file.listFiles();
        for (int i = 0; i < files.length; i++){
         if(files[i].isDirectory())
         {
             currentFilePath = files[i].getAbsolutePath();
          firstMethod(currentFilePath);//递归调用
         }else
         {
          if(!fileNamePattern.matcher(files[i].getName()).find()){
        continue;
       }
          String currentFileName = files[i].getName();
       currentFilePath = files[i].getAbsolutePath();
                System.out.println("currentFilePath:"+currentFilePath);
         }
   
   
        }
 }
 
}
2.利用监听器

public class FileListExample2 {
 
 public static void firstMethod(String dir)
 {
  String sourceDir= dir;
  java.io.File file = new java.io.File(sourceDir);
   String filemask       = "*.txt"+"$";
      filemask = java.util.regex.Pattern.compile("[*]").matcher(filemask).replaceAll(".*");
  boolean case_sensitive = true;
  java.util.regex.Pattern fileNamePattern = java.util.regex.Pattern.compile(filemask);
  if(!case_sensitive){
         fileNamePattern = java.util.regex.Pattern.compile(filemask, java.util.regex.Pattern.CASE_INSENSITIVE);
  } 
  final java.util.List<java.io.File> list_ = new java.util.ArrayList<java.io.File>();
  file.listFiles(new java.io.FilenameFilter() {
   public boolean accept(java.io.File dir, String name) {
    java.io.File file = new java.io.File(dir, name);
    if (file.isFile()) {
     list_.add(file);
     return true;
    } else {
     file.listFiles(this);//此处是关健啦!
    }
    return false;
   }
  });
  for(int i=0;i<list_.size();i++)
  {
   java.io.File files =list_.get(i);
   if(!fileNamePattern.matcher(files.getName()).find()){
    continue;
   }
      String currentFileName = files.getName();
   String currentFilePath = files.getAbsolutePath();
            System.out.println("currentFilePath:"+currentFilePath);
  }
 }
 public static void main(String[] args) {
  String directory= "C:/TDDOWNLOAD";
      firstMethod(directory);
  
 }
}
 
7月10日

CentricCRM

   前段时间接触了CentricCRM这个东西,是个Tomcat的project,但是我们要用的不多,只是http-xml api的部分。大部分资料来源于它的官方网站:http://www.centriccrm.com/ProjectManagement.do?command=ProjectCenter&section=Wiki&pid=58&subject=Centric+CRM+Tools+Package
 我自己觉得这个东西做的不是很好,别的功能我没用,但就http-xml api部分,应该还有很大的空间可以完善。(说这话,好像我很专业,其实嘛都不懂。。嘻!)也许是我还未更深入的研究透它的东西,就先将了解的部分写下来吧。
1.配置服务器
http://www.centriccrm.com/ProjectManagement.do?command=ProjectCenter&section=File_Library&pid=109&folderId=273网站down下cntricCRM 4.1.1.exe.(你可以根据OS来选择CRM的server,我嘛只会用windows,就down了个windows版的)。建议在安装CRM之前,最好装个数据库,常用的数据库就可以了。我自己安装了mysql.
2.配置CRM相关信息
安装完CRM后,记得开启tomcat,或点击CRM桌面图标,或打开IE直接输入http://127.0.0.1/centric进入centric配置页面了,就按要求填写。大体上分四步:
Step 1:  Setup the file library//我按默认了,直接点“继续”
Step 2:  Setup external servers (mail, fax)//这一步信息比较多,主要是Centric CRM Configuration Server Settings,其实也什么特别的,我就按自己的想法乱填写了,最后也没出啥错。
Step 3:  Setup the database//这一步,选择你之前安装资料库,建立好访问用户、资料库名,这样centric会将它的数据放入你填写的库中.我的是mysql,还必须将驱动程序放入tomcat下的centirc的lib目录里。
Step 4:  Setup the Centric CRM administrative user account//最后一步是配置你登录CRM系统的用户了。
全部配成功后,按继续,系统会自动导入http://127.0.0.1:8080/centric/index.jsp登录画面了,用刚才最后一步配置的用户登入,就可以了,这样centricCRM的Server就配置成功了。
3.using http-xml api
 利用XML来传输,其实和XMLRPC的原理是一样的。它的官方网站上也写的很清楚。就根据它的Action类型来看好了。
select: 
 
 
 
 
 
 
 
 
7月5日

一口气睡了20个小时

  昨天玩游戏玩到2点,猪猪两点多还发短信给我,说他好想我,睡不着,我回了短信,就开始睡觉了。。一直迷迷糊糊的,现在终于知道为什么要晚上睡觉了,我就晚上少睡了几个小时,就用今天一整天来补睡,外面街道的卡拉OK故意跟我做对是的,一直唱,唱的有点心烦,但是我还是可以睡着的,只是乱做梦,一会去打怪兽,一会又回家了,就这样反反复复的,醒来也没力气起床吃饭,就一直睡,看见电脑都有点讨厌它,睡到现在才开始有点意识。。。猪猪说他昨晚5点多才睡,今天还上了一天班,听起来蛮惨的。。。我不行了,身体不好,不能熬夜。。以后不敢这样瞎折腾了,其实那游戏没嘛意思。这个想法是在我昨晚最累的时候,手都动不了,胳膊抬不起来,。。以后不玩了,医生说我要锻炼。。。我以后去找些阳光的事情来做。。。。
7月4日

好想打游戏

  上周末极无聊,就跟一网友去学打游戏了,没想到就狂迷上了,连做梦都在跟怪兽打仗。丫的,这两天天天回家打游戏,谁我都不想理,只是网络有点慢,郁闷的要死。。。就目前看来还有点好处,呵,每晚9点半-10点半网最慢,就去呼呼啦。要么就去75下弱小动物。。。。。。。。然后再呼呼去。。。现在终于明白猪猪为啥爱玩游戏了。。可是现在才发现他玩的都是小儿科,跟不上时代了。。等他来深圳,让他帮我换家网络。。。以后猪猪玩游戏,我绝对不说。。。。但是我玩游戏,猪猪也别拦着。。。嘻嘻!!!!!
  今天猪猪问我要啥礼物。。。。我想都没想就说要化妆品。。。对啊,通宵玩游戏很容易变老,脸上出来好多细纹,本来就不显年轻。。切切。。。。要去额头纹和眼角纹的。。。最好是看你那个漂亮女同事,皮肤好的。没有皱纹的女同事。。用啥护肤品。给草草买回来。。。
只是我没玩游戏时,也没时间去护肤,大部分时间都用来呼呼了。。上次猪猪去北京,我那时一腔热血的想学英语,就让猪猪买了好记星,可是回来还是被我打游戏打的没电了。。。现在自动学习设置还在以a开头的单词里。。。早上去看时,上面都一层尘土了。。。。等猪猪回来去换个电池,我再学英语。。。
 
作者 
没有相册。
尚未添加列表。