Skip to content

Instantly share code, notes, and snippets.

@0x0all
0x0all / AdvancedDistributedSystemDesignCourseNotes.md
Created October 3, 2022 21:44 — forked from craigtp/AdvancedDistributedSystemDesignCourseNotes.md
Notes on Udi Dahan's Advanced Distributed System Design Course

Advanced Distributed System Design Course - Udi Dahan

Notes by Craig Phillips

Fallacies of Distributed Computing

  • There are 11 fallacies of Distributed Computing:
    1. The network is reliable
    2. Latency isn’t a problem
    3. Bandwidth isn’t a problem
    4. The network is secure
  1. The topology won’t change
@0x0all
0x0all / GO-Fillslice.md
Created May 2, 2022 17:03 — forked from taylorza/GO-Fillslice.md
Golang - Fill slice/array with a pattern

Filling an array or slice with a repeated pattern

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)

Fill the slice with the value 65 by looping through each element and setting the value

@0x0all
0x0all / main.go
Created July 19, 2021 21:51 — forked from yingray/main.go
Golang: aes-256-cbc examples (with iv, blockSize)
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";
}
};
@0x0all
0x0all / tsp.png
Created December 9, 2018 16:10 — forked from phelrine/tsp.png
TSP
tsp.png
@0x0all
0x0all / gist:b78e5b7b36efe920830f0de455644565
Created August 27, 2018 11:05 — forked from andrewrk/gist:1883543
function to count trailing zeros

Given an unsigned integer, return the number of trailing zero bits

Test framework:

#include <stdio.h>
#include <assert.h>

unsigned trailing_zeros(unsigned n) {
    // fill in this function
@0x0all
0x0all / kaggle_bikesharing_decistree.py
Created March 13, 2016 16:03 — forked from rowanv/kaggle_bikesharing_decistree.py
Kaggle Bike Sharing Demand - Decision Tree Regressor
import numpy as np
import pandas as pd
import statsmodels.formula.api as sm #lin reg
import pylab as py
import matplotlib as mp
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.ensemble import RandomForestRegressor
@0x0all
0x0all / kaggle_bikesharing_lasso.py
Created March 13, 2016 16:02 — forked from rowanv/kaggle_bikesharing_lasso.py
Kaggle Bike Sharing Demand Competition - Lasso
import numpy as np
import pandas as pd
import statsmodels.formula.api as sm #lin reg
import pylab as plt
import matplotlib as mp
from sklearn.linear_model import Lasso
from sklearn.linear_model import LassoCV
from sklearn.linear_model import lasso_path, enet_path
@0x0all
0x0all / kaggle_bikesharing_GBRT1.py
Created March 13, 2016 16:01 — forked from rowanv/kaggle_bikesharing_GBRT1.py
Kaggle Bike Sharing Demand Competition -- Gradient Boosted Regression Trees
import numpy as np
import pandas as pd
import statsmodels.formula.api as sm #lin reg
import pylab as py
import matplotlib as mp
from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import ExtraTreesRegressor
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import GradientBoostingClassifier, GradientBoostingRegressor