This file contains 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 |
This file contains 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
import pandas as pd | |
import numpy as np | |
from sklearn.feature_extraction import DictVectorizer | |
def encode_onehot(df, cols): | |
""" | |
One-hot encoding is applied to columns specified in a pandas DataFrame. | |
Modified from: https://gist.github.com/kljensen/5452382 | |
This file contains 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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Matlab code to produce PCA animations shown here: | |
% http://stats.stackexchange.com/questions/2691 | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Static image | |
clear all | |
rng(42) |
This file contains 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
import re | |
import os | |
import glob | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
from collections import OrderedDict | |
fig_size = [12, 9] |
In this document, I will describe how I managed to get unlimited stars and coins in the Android game "Lily's Garden". In short, here are the steps:
- Use the
adb backup
feature to extract all of the game's data - Extract the Android backup into a tar file
- Modify the file which stores the number of coins and stars
- Re-sign the coins/stars field using a reverse-engineered HMAC key
- Convert the tar file back to an Android backup
This file contains 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
#!/usr/bin/env python3 | |
# Author: Alexandre Défossez, 2020 | |
# This is free and unencumbered software released into the public domain. | |
# For more information, please refer to <http://unlicense.org/> | |
""" | |
Merge multiple bibfiles, remove duplicates and unused references, matching bibtex entries | |
based on the 'title' field. Rewrite all the .tex files in the current directory | |
to reflect the elimination of duplicates. | |
Finally, this will rewrite all the arXiv references to use the @unpublished category. |