Skip to content

Instantly share code, notes, and snippets.

View kumagi's full-sized avatar
:octocat:
Fine.

Hiroki KUMAZAKI kumagi

:octocat:
Fine.
View GitHub Profile
#include <stdio.h>
#include <pthread.h>
#include <sys/eventfd.h>
#include <unistd.h>
struct workset {
int tid_;
int efd_;
};
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/time.h>
#include <assert.h>
int main(void) {
size_t a = 2;
int b = 10;
@kumagi
kumagi / benchmark.cc
Created June 17, 2012 03:23
single thread Hopscotch hashing with C++
#ifndef MAP_HPP
#define MAP_HPP
//#include <cstdint>
#include <stdint.h>
#include <cstddef>
#include <map>
#include <functional>
#include <boost/functional/hash.hpp>
#include <memory>
#include <utility>
@kumagi
kumagi / jubatus_cluster.py
Created July 5, 2016 12:13
出力を見てあれこれする
import subprocess
import sys
import os
import signal
import time
import re
class JubatusCluster(object):
def __init__(self):
self.procs = {}
@kumagi
kumagi / hibari-bench.py
Created October 12, 2011 11:51
hibari-python
from sys import path
from os.path import dirname
from time import time
path.append('../')
from ebf_client import HibariClient
begin = time()
client = HibariClient('localhost', 7580)
for i in range(100):
for i in range(10):
void msd_first_parallel_radix_sort(const std::vector<uint64_t>::iterator& begin,
const std::vector<uint64_t>::iterator& end) {
const auto size = std::distance(begin, end);
const int nthreads = cpu_num(); // number of threads
constexpr size_t bytes = sizeof(uint64_t);
constexpr size_t nbuckets = 256;
constexpr int kOutBuff = 8;
std::vector<std::array<uint64_t, nbuckets> > offsets(nthreads);
@kumagi
kumagi / kenasaku_ouen.rb
Last active March 11, 2016 02:54
検索は応援になる
require 'selenium-webdriver'
class KensakuOuen
def initialize()
@driver = Selenium::WebDriver.for :firefox
end
def search(keyword)
begin
@driver.manage.delete_all_cookies
@driver.get "http://www.yahoo.co.jp"
#include <string>
#include <iostream>
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>
#include <log4cxx/helpers/exception.h>
#include <log4cxx/helpers/properties.h>
#include <assert.h>
log4cxx::LoggerPtr logger_ __attribute__((init_priority(10)));
@kumagi
kumagi / radix_sort.cpp
Last active January 14, 2016 16:02
速くならん
//
// Created by kumagi on 16/01/13.
//
#ifndef BETASORT_RADIX_SORT_HPP
#define BETASORT_RADIX_SORT_HPP
#define _GNU_SOURCE 1
#include <sched.h>
#include <assert.h>
@kumagi
kumagi / main.cc
Created January 14, 2016 14:42
ベタ書きすまぬ
#include <algorithm>
#include <iostream>
#include <sstream>
#include <random>
#include "radix_sort.hpp"
#include <chrono>