This policy has moved: https://drneet.app/privacy/
This policy has moved: https://drneet.app/privacy/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| from random import choices, sample | |
| from statistics import mean | |
| def common_birthday(k): | |
| '''Generate k independent uniformly random birthdays & check if there are any repeats''' | |
| birthdays = choices(range(1, 366), k=k) | |
| return len(set(birthdays)) != k | |
| >>> mean(common_birthday(23) for _ in range(10000)) | |
| 0.4979 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| sudo apt-get install python-pip python-dev build-essential | |
| sudo pip install --upgrade pip | |
| sudo pip install --upgrade gensim |
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
| from random import randint | |
| from random import uniform, gauss | |
| def gaussian(mu, sigma = 0.1): | |
| prob = gauss(mu, sigma) | |
| if prob < 0: | |
| return 0.0 | |
| elif prob > 1: | |
| return 1.0 | |
| 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
| tr -cs A-Za-z '\n' | | |
| tr A-Z a-z | | |
| sort | | |
| uniq -c | | |
| sort -rn | | |
| sed ${1}q |
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 | |
| Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
| Read 4K randomly from SSD* 150,000 ns 0.15 ms |
NewerOlder