Skip to content

Instantly share code, notes, and snippets.

View rava-dosa's full-sized avatar

Apoorva Kumar rava-dosa

View GitHub Profile
  1. Tom Misch
  2. Arcade
  3. Kwayne
  4. Bruno major
.
.
.

What does it mean to have a really deep introverted emotion, probably not everything is in explicit, there are a lot on implicit underlying emotions at work, which are mentioned here and there in words but never brought in open.

  1. Her
  2. Demolition
  3. Ship of Theseus
  4. Into the wild

Movies about introverts but not written with lot of deep introverted emotion(Just missed).

  1. the perks of being a wallflower.
  2. la la land.

Some commands

  1. react-native run-android
  2. npm start -- --reset-cache
  3. ./gradlew clean
  4. adb reverse tcp:8081 tcp:8081
  5. adb shell input text "RR"
@rava-dosa
rava-dosa / latency.txt
Created March 23, 2019 05:34 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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
  1. conda create -n dbms python=3.4 pip
  2. source activate dbms
  3. pip install -r requirements.txt

open python shell

  1. import psycopg2
  2. conn = psycopg2.connect(dbname="mydb", user="myuser", password="mypass",host="localhost")
  3. cur = conn.cursor()
  4. cur.execute("CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);")
  5. cur.execute("INSERT INTO test (num, data) VALUES (%s, %s)",(100, "abc'def"))

emergency

  1. su root

  2. su postgres

  3. psql

  4. CREATE ROLE myuser LOGIN password 'secret';

  5. ALTER USER user_name WITH PASSWORD 'new_password';

  6. sudo service postgresql restart

  7. sudo apt-get update

  8. sudo apt-get install postgresql postgresql-contrib