Skip to content

Instantly share code, notes, and snippets.

View eiichiroi's full-sized avatar

Eiichiro Iwata eiichiroi

View GitHub Profile
@eiichiroi
eiichiroi / C.cpp
Created December 12, 2018 12:22
ICPC 2018 Yokohama Regional Problem C
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Seat {
int x;
int y;
};
@eiichiroi
eiichiroi / matmul.cpp
Last active November 2, 2017 08:46
行列積のループ交換法の簡易ベンチマーク
#include <iostream>
#include <iomanip>
#include <random>
#include <cassert>
#include <cstdlib>
#include <sys/time.h>
struct Host {
Host(int num)
: num(num), A(num*num), B(num*num), C(num*num) {
defkanji utf-8
defencoding utf-8
encoding utf-8 utf-8
escape ^t^t
startup_message off
vbell off
bind w windowlist -b
hardstatus alwayslastline "[%02c] %`%-w%{=b bw}%n %t%{-}%+w"
@eiichiroi
eiichiroi / generate-pficommon-coverage.sh
Created May 9, 2012 11:04
How to measure the coverage of pficommon
#!/bin/sh
## Please install lcov first.
# wget http://downloads.sourceforge.net/ltp/lcov-1.9.tar.gz
# tar xzf lcov-1.9.tar.gz
# cd lcov-1.9
# sudo make install
## Build and measure the coverage with running tests
CXXFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-lgcov" ./waf configure
@eiichiroi
eiichiroi / test.cpp
Created April 18, 2012 15:39
A little special serialize method
// g++ -I/path/to/include -L/path/to/lib -lpficommon test.cpp
#include <stdint.h>
#include <pficommon/text/json.h>
#include <pficommon/data/serialization.h>
struct Widget {
explicit Widget(int64_t value) : value_(value) {}
int64_t value_;
@eiichiroi
eiichiroi / fluent_logging_glog.cpp
Created October 30, 2011 12:00
Fluent Logger for glog
#include <iostream>
#include <sstream>
#include <string>
#include <ctime>
#include <glog/logging.h>
#include <msgpack.hpp>
#include <pficommon/text/json.h>
#include <pficommon/network/socket.h>