This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __PTREE_H__ | |
#define __PTREE_H__ | |
#include <sys/types.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __RBTREE_H__ | |
#define __RBTREE_H__ | |
#include <assert.h> | |
#include <string> | |
#ifdef DEBUG | |
#include "debug.h" | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <time.h> | |
#include <sys/time.h> | |
#include <stdarg.h> | |
#include <stdio.h> | |
#define dmsg(X, ...) \ | |
do { \ | |
struct tm td; \ | |
struct timeval tv; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import array | |
a = array.array('B', [3, 1, 2,5,41,44,231,212,0,66,67,68]) | |
b = buffer(a.tostring()) | |
conn = sqlite3.connect ('test.db') | |
conn.execute ('create table if not exists test (id integer primary key, b blob)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Tscreen < Formula | |
url 'http://www.steve.org.uk/Software/tscreen/dist/tscreen-0.4.9.tar.gz' | |
sha256 'b920f1a96dfa8a390601a8e78fc7ab49d4599f7544e30cfdae5ea0e0aeb0305d' | |
def install | |
system "./configure", "--disable-debug", "--prefix=#{prefix}", "--enable-colors256" | |
system "make install" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
#---------------------------------------------------- | |
# packet capture & decoding | |
import pcapy | |
import dpkt | |
class network_monitor: | |
def __init__ (self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
PID_FILE=$HOME/local/var/run/`basename $0`.pid | |
NIC=en0 | |
DATA_DIR=$HOME/local/var/data | |
FNAME_PREFIX="dump" | |
FILTER="port not 80" | |
if [ "`id -u`" != "0" ] | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ $# != 1 ] | |
then | |
echo 'syntax)' `basename $0` '<movie>' | |
exit | |
fi | |
target=$1 | |
base=`echo $target | sed -e 's@\.[a-z0-9]*$@@g'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// build) g++ v8_test.cc -o v8_test -lv8 | |
#include <v8.h> | |
#include <string> | |
char * js_src = | |
"function laugh() {" | |
" print ('HAHAHA'); " | |
"}; " | |
"s = append ('echo');" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <pthread.h> | |
#include <sys/time.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
long long TEST_NUMBER ; | |
typedef struct { | |
pthread_mutex_t mutex; |
OlderNewer