Skip to content

Instantly share code, notes, and snippets.

@AlexManduley
AlexManduley / gist:3232286
Created August 2, 2012 01:27 — forked from swannodette/gist:3217582
sudoku_compact.clj
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
(defn init [vars hints]
@AlexManduley
AlexManduley / gist:2998789
Created June 26, 2012 20:39
Simple Timer for Performance
#If DEBUG Then
Dim t As New Date
t = Now
#End If
#If DEBUG Then
Dim x As Integer = Now.Millisecond - t.Millisecond
Debug.WriteLine("elapsed time:" & x)
#End If
@AlexManduley
AlexManduley / latency.txt
Created May 31, 2012 18:47 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns