Skip to content

Instantly share code, notes, and snippets.

View mitake's full-sized avatar
💭
I may be slow to respond.

Hitoshi Mitake mitake

💭
I may be slow to respond.
  • 21:45 (UTC +09:00)
View GitHub Profile
[2015/08/20-16:10:36.847511] xio_tcp_datapath.c:1753 [ERROR] - partial completion of request due to missing, response buffer
[2015/08/20-16:10:36.847559] xio_tcp_datapath.c:1812 [ERROR] - xio_tcp_send_msg failed
[2015/08/20-16:10:36.847580] xio_nexus.c:2200 [ERROR] - transport send failed err:1247689306
@mitake
mitake / CMakeLists.txt
Created March 6, 2013 14:09
sample of DynamoRIO client
cmake_minimum_required(VERSION 2.8)
SET(DynamoRIO_DIR "/home/mitake/dynamorio/exports/cmake")
find_package(DynamoRIO)
add_library(sample SHARED sample.c)
configure_DynamoRIO_client(sample)
@mitake
mitake / replace.py
Last active December 11, 2015 12:49
string replace in python
#! /usr/bin/env python
import sys, re
def conf_file(path):
f = open(path, 'r')
res = []
for line in f.readlines():
line = line.replace('vprintf', 'sd_printf')
line = line.replace('eprintf', 'sd_eprintf')
@mitake
mitake / party-accounting.pl
Created December 8, 2012 06:22
Party accounting
% usage:
% $ swipl -o party-accounting -c party-accounting.pl
% $ ./party-accounting
% ?- main.
:- use_module(library('clp/bounds')).
party_accounting(Nr_manager, Manager_yen, Nr_principle, Principle_yen, Nr_director, Director_yen, Nr_hira, Hira_yen, Total_yen) :-
Manager_yen in 0..Total_yen,
@mitake
mitake / evhttp-multh-thread-httpd.cpp
Created November 5, 2012 07:10 — forked from kzk/evhttp-multh-thread-httpd.cpp
Multi-Threaded HTTPServer using evhttp
// g++ evhttp-multh-thread-httpd.cpp -levent
#include <event.h>
#include <evhttp.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/types.h>
@mitake
mitake / gist:3924195
Created October 20, 2012 17:51
easy string format without runtime memory allocation, example of IP address
#include <stdio.h>
#include <string.h>
#define BUF_NUM 32
#define BUF_LEN 16
static char *format(int val)
{
static char buf[BUF_NUM][BUF_LEN];
static int buf_i;