Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com |
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 |
update(ft, p, v): | |
for (; p <= N; p += p&(-p)) | |
ft[p] += v | |
# Add v to A[a...b] | |
update(a, b, v): | |
update(B1, a, v) | |
update(B1, b + 1, -v) | |
update(B2, a, v * (a-1)) | |
update(B2, b + 1, -v * b) |
Codeforces CSRF |
// In the name of Allah. | |
// We're nothing and you're everything. | |
// Ya Ali! | |
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
const int maxn = 1e2 + 14, lg = 15; |
import os | |
import sys | |
import json | |
import model_control | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout, Activation, Flatten | |
from keras.layers import Convolution2D, MaxPooling2D | |
from keras.optimizers import SGD | |
import numpy as np | |
from numpy import loadtxt, asarray |
void lava_set(unsigned int bn, unsigned int val); | |
extern unsigned int lava_get(unsigned int) ; | |
static unsigned int lava_val[1000000] = {0}; | |
void lava_set(unsigned int bug_num, unsigned int val); | |
void lava_set(unsigned int bug_num, unsigned int val) { lava_val[bug_num] = val; } | |
unsigned int lava_get(unsigned int bug_num); | |
unsigned int lava_get(unsigned int bug_num) { return lava_val[bug_num]; } | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> |
#include "klee/klee.h" | |
#include <assert.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
//types and constants used in the functions below | |
const uint64_t m1 = 0x5555555555555555; //binary: 0101... | |
const uint64_t m2 = 0x3333333333333333; //binary: 00110011.. | |
const uint64_t m4 = 0x0f0f0f0f0f0f0f0f; //binary: 4 zeros, 4 ones ... | |
const uint64_t m8 = 0x00ff00ff00ff00ff; //binary: 8 zeros, 8 ones ... |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb