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
| //An exact copy of the adafruit DTH-11 driver in C# | |
| //Example usage: | |
| //var gpio = GpioController.GetDefault(); | |
| //var dataPin = gpio.OpenPin(5); |
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 | |
| -------------------------- | |
| 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 |
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 hiddenProperty = 'hidden' in document ? 'hidden' : | |
| 'webkitHidden' in document ? 'webkitHidden' : | |
| 'mozHidden' in document ? 'mozHidden' : | |
| null; | |
| var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange'); | |
| var onVisibilityChange = function(){ | |
| if (!document[hiddenProperty]) { | |
| document.title = 'test'; |
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
| //http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript | |
| function guid() { | |
| function s4() { | |
| return Math.floor((1 + Math.random()) * 0x10000) | |
| .toString(16) | |
| .substring(1); | |
| } | |
| return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
| s4() + '-' + s4() + s4() + s4(); | |
| } |
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
| @echo on | |
| :loop | |
| echo Start checking | |
| rem :请把下面的 check.bat* 更换你想要的windowtitle,不支持模糊查询,只能在后面*来区别 | |
| for /F "tokens=2 delims=," %%a in ('tasklist /fo csv /v /fi "windowTitle eq loopCheck.bat*"') do ( | |
| echo Infinity is exist, wait 5 sechond and re-check. | |
| ping -n 5 127.1>nul |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |