Notes by Craig Phillips
- There are 11 fallacies of Distributed Computing:
- The network is reliable
- Latency isn’t a problem
- Bandwidth isn’t a problem
- The network is secure
- The topology won’t change
Looking for an efficient pure GO approach to copy repeating patterns into a slice, for a toy project, I ran a few tests and discovered a neat approach to significantly improve performance. For the toy project, I am using this to fill a background buffer with a specific RGB color pattern, so improving this performance significantly improved my acheivable framerate.
All the test were run with a buffer of 73437 bytes, allocated as follows
var bigSlice = make([]byte, 73437, 73437)
| for num in chain(range(12_300, 40_944), | |
| range(44_000, 64_207)): |
| import string | |
| info = [eval(f"('{a}', string.{a})") for a in dir(string) if not a.startswith("_")] | |
| for elem in info: | |
| print(elem) |
| # https://stackoverflow.com/questions/57340713/how-do-i-un-shuffle-a-list-back-to-its-original-form | |
| import random | |
| def getperm(l): | |
| random.seed(101) | |
| perm = list(range(len(l))) | |
| random.shuffle(perm) | |
| return perm |
| sudo rm /etc/apt/preferences.d/nosnap.pref | |
| sudo apt update | |
| sudo apt install snapd |
| package main | |
| import ( | |
| "bytes" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "encoding/hex" | |
| "fmt" | |
| ) |
| import cv2 | |
| cap = cv2.VideoCapture(0) | |
| # Capture frame | |
| ret, frame = cap.read() | |
| if ret: | |
| cv2.imwrite('image.jpg', frame) | |
| cap.release() |
| #include <memory> | |
| #include <iostream> | |
| class objectA { | |
| public: | |
| ~objectA() { | |
| std::cout << "A"; | |
| } | |
| }; |
| set session transaction isolation level read comitted; - сразу данные видны в текущей сессии из другой сессии | |
| start transaction; | |
| ... | |
| commit; | |
| set session transaction isolation level repeatable read; - данные не видны в текущей сессии из другой сессии |