I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
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
| #text hockey | |
| $players = [] | |
| $player_location = [1,2,3,1,2,2] | |
| $location_desc = {0 => "behind own net", 1 => "in your defensive zone", 2 => "at center ice", 3 => "in the attacking zone", 4 => "behind CPU's goal"} | |
| $possession = [0,0,0,0,0,0] | |
| $score = [0,0] | |
| $action = [0,4+rand(4)] | |
| $shot_pct = [0, 0.001, 0.01, 0.25, 0.05] | |
| def add_players |
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
| class Player | |
| def initialize(name, poss, shoot_pct, pass_pct) | |
| @name = name | |
| @@poss = poss | |
| @shoot_pct = shoot_pct | |
| @pass_pct = pass_pct | |
| end | |
| def shoot | |
| rand = rand(0) |
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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |