- What can be traced?
- How can trace events be specified?
- "match specifications": twisty passages, all alike
- WTF, can I just use DTrace and drink my coffee/beer/whisky in peace?
- Trace delivery mechanisms: pick one of two
Latency Comparison Numbers | |
-------------------------- | |
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 | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
So far, all the properties we have written have tested stateless code. Stateless code is made up of pure functions and is inherently easier to test than stateful code with side effects. The chief problem with testing stateful code is that the input to output mapping depends on the current state of the program. Previous operations can cause the same function to return different output given the same input. Therefore, in order to test stateful code, our tests must maintain some state of their own. This state is known as the model state and is updated as part of the testing process.
I hereby claim:
- I am zeeshanlakhani on github.
- I am zeeshanlakhani (https://keybase.io/zeeshanlakhani) on keybase.
- I have a public key whose fingerprint is 1AC6 B34F BA77 A396 AB72 6F85 5D47 A705 052B 85B3
To claim this, I am signing this object:
# List of all the valid pdf URLs ever posted to the #Clojure IRC channel. | |
# | |
# Many of them are interesting CS papers others are not that useful. What I've done: | |
# | |
# 1. crawled an IRC history archive for the channel | |
# 2. extract pdf list in a file with: grep -riIohE 'https?://[^[:space:]]+pdf' * > pdf-links.txt | |
# 3. remove dupes: cat pdf-links.txt | sort | uniq > pdf-links-uniq.txt | |
# 4. filter only HTTP 200: cat pdf-links-uniq.txt | xargs curl -o /dev/null --connect-timeout 2 --silent --head --write-out '%{http_code} %{url_effective}\n' | grep "^200" > valid-pdf-links.txt | |
# | |
# Now your choice to download them all or not. If you want, use: cat valid-pdf-links.txt | awk '{print $2}' | xargs wget |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
USING: kernel math sequences ; | |
IN: euler1 | |
: multiple-of ( x y -- z ) mod zero? ; | |
: euler1 ( x -- y ) | |
1 - iota [ 1 + ] map | |
[ dup [ 3 multiple-of ] [ 5 multiple-of ] bi or [ ] [ drop 0 ] if ] | |
map | |
sum |
four primitives: run*, ==, conde, fresh | |
(run* (q) | |
(== q #t)) | |
; for what values of q is q equal to true? | |
answer: q must also be #t, so | |
'(#t) ; answer comes back in a list |
# time | |
# ==== | |
macro time(ex) | |
quote | |
local t0 = time_ns() | |
local val = $(esc(ex)) | |
local t1 = time_ns() | |
println("elapsed time: ", (t1-t0)/1e9, " seconds") | |
val |
(ns markerbot.core | |
(:require [taoensso.timbre :as log] | |
[clojure.data.json :as json] | |
[clojure.string :as s] | |
[clj-http.client :as client]) | |
(:import (java.net Socket) | |
(java.io PrintWriter InputStreamReader BufferedReader)) | |
(:gen-class)) | |
;; marksy |