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
| <!doctype html> | |
| <html lang="zh-cmn-Hans-CN"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>wiki validate password demo</title> | |
| <style type="text/css" rel="stylesheet"> | |
| #pwd { | |
| width: 80%; | |
| border-width: 2px; |
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
| /*center an image */ | |
| img.center { | |
| display: block; | |
| margin-left: auto; | |
| margin-right: auto; | |
| } |
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
| html { | |
| background: url(img/background.jpg) no-repeat center center fixed; | |
| -webkit-background-size: cover; | |
| -moz-background-size: cover; | |
| -o-background-size: cover; | |
| background-size: cover; | |
| } | |
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
| import java.util.Collections; | |
| import java.util.Map; | |
| import java.util.concurrent.ConcurrentHashMap; | |
| public class ConcurrentCarMonitor { | |
| private final ConcurrentHashMap<String,Point> locations; | |
| public ConcurrentCarMonitor(Map<String,Point> locations){ | |
| this.locations = new ConcurrentHashMap<String,Point>(locations); | |
| } |
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
| import java.util.Collections; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| public class CarMonitor { | |
| private final Map<String,MutablePoint> locations; | |
| public CarMonitor(Map<String,MutablePoint> locations){ | |
| //确保传入的locations引用在其他作用域修改不会影响类中的locations状态 | |
| this.locations = deepClone(locations); |
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.prototype.bind = Function.prototype.bind || function(o){ | |
| var args = []; | |
| var self = arguments.callee; | |
| var len = arguments.length; | |
| if(len > 1){ | |
| for(var i = 1; i < len; i++){ | |
| args.push(arguments[i]); |
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"}; |
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 uniqueInteger = (function(){ | |
| var index = 0; | |
| function f (){ | |
| return index++; | |
| } | |
| return f(); | |