摘要: 1、String中的每个字符都是一个16位的Unicode字符,用Unicode很容易表达丰富的国际化字符集,比如很好的中文支持。甚至Java的标识符都可以用汉字,但是没人会用吧(只在一本清华的《Java2实用教程》看过)。2、判断空字符串。根据需要自己选择某个或者它们的组合 if ( s == null ) //从引用的角度 if ( s.length() == 0 ) //从长度判别 if ( s.trim().length () == 0 ) //是否有多个空白字符trim()方法的作用是是移除前导和尾部的Unicode值小于'"u0020'的字符,并返回“修剪 阅读全文
posted @ 2013-03-02 10:14 ilxx1988 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 添加必要的注释,对一个有责任心、有道德模范的前端必须具备的好习惯,可以大大提高代码的可维护性、可读性。java代码注释快捷键:ctrl+shift+/ 首先熟悉一下html、css、js的注释的写法: 1、HTML注释语法:<!--注释的内容-->2、css注释语法/* 注释内容 *//* ----------文字样式开始---------- */3、javaScript注释//注释内容/*注释内容*/接下来是对注释在这几种代码中使用的位置,如何写注释进行总结一下。(根据个人的习惯可能不一样) 1、html注释 使用的位置: 1)一般会使用在一些主要节点标签结束的后边,如:< 阅读全文
posted @ 2013-03-01 09:37 ilxx1988 阅读(219) 评论(0) 推荐(0) 编辑
摘要: http://hi.baidu.com/flyer_hit/blog/item/2ec12d251dd9dd6835a80f55.htmlhttp://blog.csdn.net/feixiangcq/archive/2010/06/06/5650672.aspxhttp://fan.cos.name/cn/2010/10/fan16/http://hi.baidu.com/flyer_hit/blog/item/84d29a733c7751148701b089.htmlLDA是比PLSA更“高级”的一种topic model。“高级”在哪里呢?--它是一个Bayes Hierarchy Mo 阅读全文
posted @ 2013-02-28 11:14 ilxx1988 阅读(7123) 评论(1) 推荐(0) 编辑
摘要: LDA的整体流程 阅读全文
posted @ 2013-02-27 21:40 ilxx1988 阅读(3736) 评论(1) 推荐(0) 编辑
摘要: temp.substring(temp.indexOf(strs[1]))substring的参数是int型,因此必须用indexof,而charat只是定位到某一个字符。 阅读全文
posted @ 2013-02-26 11:39 ilxx1988 阅读(148) 评论(0) 推荐(0) 编辑
摘要: import java.util.Collection;import java.util.HashMap;import java.util.Iterator;public class HashDemo {public static void main(String[] args){ HashMap<String,Integer> hs=new HashMap<String,Integer>(); hs.put("a",1); hs.put("b", 2); hs.put("c", 3); /*Collectio 阅读全文
posted @ 2013-01-29 23:30 ilxx1988 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 import java.util.EnumSet; 2 3 enum FontConstant{Plain,Bold,Italic} 4 public class EnumSetDemo { 5 public static void main(String[] args){ 6 EnumSet<FontConstant> enumSet=EnumSet.of(FontConstant.Plain,FontConstant.Bold); 7 showEnumSet(enumSet); 8 9 showEnumSet(EnumSet.complementO... 阅读全文
posted @ 2013-01-29 23:26 ilxx1988 阅读(192) 评论(0) 推荐(0) 编辑
摘要: View Code import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileInputStream;import java.io.FileReader;import java.io.FileWriter;import java.io.IOException;import java.io.InputStream;import java.io.PrintWriter;import java 阅读全文
posted @ 2012-10-25 16:39 ilxx1988 阅读(243) 评论(1) 推荐(0) 编辑
摘要: import java.util.Random;/** * verrification Code * @author TJX * @version 20121025 */public class Code { static Random rd=new Random(); public static void main(String[] args){ numCode(); charCode(); chineseCode(); mixCode(); } public static void numCode(){ System.out.pr... 阅读全文
posted @ 2012-10-25 14:50 ilxx1988 阅读(809) 评论(0) 推荐(0) 编辑
摘要: //合并两个数组public class Merge { public static int[] Merge (int[]a,int[] b){ int la=a.length; int lb=b.length; int pa=0,pb=0,pc=0; int[] c=new int[la+lb]; while(pa<la&&pb<lb){ if(a[pa]<b[pb]){ c[pc++]=a[pa++]; } else{ ... 阅读全文
posted @ 2012-06-18 21:06 ilxx1988 阅读(187) 评论(0) 推荐(0) 编辑