Apr 07 2011

Test Syntax Highlighter

Category: 技术ssmax @ 18:47:55
bash
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

java

 public static final int[] sum = { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
 public static final char[] check = { '1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2' };

 public static String getDate(int next)
 {
  Calendar caltime=Calendar.getInstance();
  caltime.add(Calendar.DAY_OF_MONTH,next);

  return  Config.objFormat.format(caltime.getTime());
 }
 public static boolean checkValid(String nid) {
  if(nid!=null)
  {
   nid = nid.trim();
  }
  nid = nid.toUpperCase();
  if(nid.length()>18 || nid.length()<16)
  {
   return false;
  }
  if (nid.matches("^\\d{15,17}[\\dX]$"))
  {
   return true;
  }
  return false;
 }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.