This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestRegEx { | |
| public static Set<String> praseHtml(String html,String regEx) throws MalformedPatternException{ | |
| Set<String> set = new HashSet<String>(); | |
| PatternCompiler patCo = new Perl5Compiler(); | |
| Pattern pattern = patCo.compile(regEx); | |
| PatternMatcher parMa = new Perl5Matcher(); | |
| PatternMatcherInput patMI= new PatternMatcherInput(html); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Mess_zh_CN extends ListResourceBundle{ | |
| private Object[][] contents = { | |
| {"mess","你好{0},今天是{1}"} | |
| } | |
| @Override | |
| public Object[][] getContents(){ | |
| return contents; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class IllegalArgumentException extends Exception { | |
| private static final long serialVersionUID = -415036586471609768L; | |
| private Throwable cause = this; | |
| public IllegalArgumentException(Throwable ex,String msg){ | |
| super(msg); | |
| this.cause = ex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FileUrl { | |
| public void getFileChildrenUrl(File file, int length, final String suffix) { | |
| length++; | |
| File[] fileList = file.listFiles(new FileFilter() { | |
| @Override | |
| public boolean accept(File pathname) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestRandomAccessFile { | |
| public void insertIntoFile(File file, String target, String content) { | |
| RandomAccessFile raf = null; | |
| PrintStream ps = null; | |
| BufferedReader br = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $add = function ($i) use (&$add){ | |
| if($i == 0 || $i == 1){ | |
| return 1; | |
| } | |
| return $add($i - 1) + $add($i -2); | |
| }; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getTotal(obj){ | |
| for(; obj.next; obj = obj.next){ | |
| return obj; //返回数据结构的最后一个元素 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var uniqueInteger = (function(){ | |
| var index = 0; | |
| function f (){ | |
| return index++; | |
| } | |
| return f(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(/* object */o,/* property */name,/* predicate function */predicate){ | |
| var index = 0; | |
| o["set" + name] = function(v){ | |
| if(predicate && !predicate(v)){ | |
| throw new Error("invalid value"); | |
| } | |
| else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* var name = "stignded"; | |
| name.length = 5; | |
| //alert(name.toUpperCase()); | |
| //alert(name); | |
| //alert(eval(name + "H")); | |
| var tenSquare = (function (x){return x*x;}(10)); | |
| alert(tenSquare); | |
| var obj1 = {name:"Stig"}; |
OlderNewer