Skip to content

Instantly share code, notes, and snippets.

View hensou's full-sized avatar

Henrique Sousa hensou

View GitHub Profile
@yogthos
yogthos / clojure-beginner.md
Last active May 6, 2024 08:11
Clojure beginner resources

Introductory resources

@pjdietz
pjdietz / Virtual Box Host Only Static IP.md
Created June 12, 2013 19:01
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@jopereira
jopereira / showtpc.py
Last active December 5, 2020 19:48
Simple analysis of Escada TPC-C and PHARM/UW-Madison TPC-W results.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Simple analysis of Escada TPC-C and PHARM/UW-Madison TPC-W results.
# by José Pereira, jop@di.uminho.pt.
import scipy.stats as st
import numpy as np
import getopt, sys
try:
@jboner
jboner / latency.txt
Last active May 17, 2024 01:05
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