Skip to content

Instantly share code, notes, and snippets.

@tatsuhiro-t
tatsuhiro-t / puzzle.in
Created September 17, 2011 06:39
GDD2011JP Sliding Puzzle
72187 81749 72303 81778
5000
5,6,12=E4D9HIF8=GN576LOABMTPKQSR0J
6,5,238=I67E9MBC1AF05HJKRLNGPDQSTO
4,6,94827601A3BCD5JGMEFNHLKI
6,5,82935=174ABCD=RHTNJKFLI0PQSOGM
5,5,13O7D69E0ABC524LGJIFMN8HK
6,5,2395OI1AHB4C07KT6SJR8F=M=QEDGL
3,3,168452=30
5,5,1245A9I7JN03HDO6GCKF8BLEM
#include <iostream>
#include <chrono>
#include <aria2/aria2.h>
int main()
{
aria2::libraryInit();
// session is actually singleton: 1 session per process
aria2::Session* session;
@tatsuhiro-t
tatsuhiro-t / spdylay-issues69.patch
Last active December 17, 2015 17:08
2nd patch for spdylay issue69, to give lower priority streams more chance to deliver output.
diff --git a/lib/spdylay_outbound_item.h b/lib/spdylay_outbound_item.h
index 12db6a6..21ebef9 100644
--- a/lib/spdylay_outbound_item.h
+++ b/lib/spdylay_outbound_item.h
@@ -50,6 +50,7 @@ typedef struct {
spdylay_frame_category frame_cat;
void *frame;
void *aux_data;
+ int inipri;
int pri;

hpack-test-case compression ratio

The each cell has X (Y/Z) format:

X
Y / Z
Y
number of bytes after compression

Z

@tatsuhiro-t
tatsuhiro-t / 0001-Update-nghttp2-to-latest-supporting-h2-11.patch
Created April 5, 2014 12:36
mruby-http2 patch to upgrade nghttp2 and support h2-11
From 1d9ddfc0c0bf041461a321313d1a6af7286fc23e Mon Sep 17 00:00:00 2001
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Date: Sat, 5 Apr 2014 21:34:45 +0900
Subject: [PATCH] Update nghttp2 to latest, supporting h2-11
---
mrbgem.rake | 2 +-
src/mrb_http2.c | 1 +
src/mrb_http2.h | 6 ++++--
src/mrb_http2_client.c | 13 ++++++-------
@tatsuhiro-t
tatsuhiro-t / 0001-Attempt-to-decode-HTTP-2-header-block-using-nghttp2-.patch
Created April 29, 2014 07:35
[PATCH] Attempt to decode HTTP/2 header block using nghttp2 HPACK decoder
From db7d7ebfe6281835f33b74f1ece22acdc3b176bf Mon Sep 17 00:00:00 2001
From: Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
Date: Tue, 29 Apr 2014 16:28:41 +0900
Subject: [PATCH] Attempt to decode HTTP/2 header block using nghttp2 HPACK
decoder
In this patch, We use nghttp2 HPACK decoder to decompress HTTP/2 header
block. To make HPACK decompressor work, we need to track down HTTP/2
connection from the beginning. If we see the HTTP/2 magic (connection
preface), we initialize HPACK decompressor objects. We actually use
@tatsuhiro-t
tatsuhiro-t / libev-4.19-android.patch
Created January 11, 2015 07:53
Patch for libev-4.19 to compile with Android NDK r10c
diff -urN libev-4.19.orig/config.sub libev-4.19/config.sub
--- libev-4.19.orig/config.sub 2014-05-23 03:53:16.000000000 +0900
+++ libev-4.19/config.sub 2015-01-11 16:46:06.915460125 +0900
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@tatsuhiro-t
tatsuhiro-t / bench-backend.conf
Last active August 4, 2017 17:24
HTTP/2 server benchmark Jan 2015
listen: 3001
http2-max-concurrent-requests-per-connection: 1024
max-connections: 15000
num-threads: 1
hosts:
localhost:
paths:
/:
file.dir: /path/to/htdocs
@tatsuhiro-t
tatsuhiro-t / sample.rst
Created March 26, 2015 11:06
h2load against gRPC greeter_server

command-line:

$ h2load http://localhost:50051/helloworld.Greeter/SayHello \
      -d grpc-upload \
      -H 'te: trailers'
      -H 'content-type: application/grpc'
      -n1000000 -c100 -m100

Create grpc-upload file using following python script: