Go ahead!

Memoization for Everything

The basics of Fluentd

| Comments

On Mar. 7th, Fluentd meetup in Fukuoka was held at OnRAMP.

Fluentd meetup in Fukuoka (in japanese)

In this event, I presented The basics of Fluentd. The purpose of presentation shares Fluentd concept and basic features. I hope this presentation helps your understading of Fluentd.

Thanks to matsuzaki-san and hashimoto-san for meetup setup and thank you everyone for your participation!

I had a great time at Fukuoka :)

LTSV for D

| Comments

In this week, Shinji Tanaka announced Labeled Tab-separated Values (LTSV). LTSV is the flexible and robust row oriented format.

I just implemented ltsv-d for D programming language.

LTSV for D

ltsv-d provides fromLTSV and toLTSV functions.

fromLTSV for parsing:

1
2
3
auto apacheLog = "host:127.0.0.1\tident:-\tuser:foo\ttime:[10/Oct/2000:13:55:36 -0700]\treq:GET /apache.gif HTTP/1.0\tstatus:200\tsize:777\treferer:http://www.example.com/start.html\tua:Mozilla/4.08 [en] (Win98; I ;Nav)";
auto record = fromLTSV(apacheLog);
writeln(record["host"]); // "127.0.0.1"

toLTSV for dumping:

1
2
auto line = ["foo":"bar", "hoge":"fuga", "piyo":"puyo"].toLTSV();
writeln(line); // "foo:bar\thoge:fuga\tpiyo:puyo"

Enjoy LTSV!

yajl-d

| Comments

yajl-d is the D binding for YAJL.

YAJL provides the stream JSON parsing and some extra features, e.g. allow comments.

yajl-d also provides the JSON encoding and stream decoding. yajl-d is 2 - 3 times faster than std.json (try simple benchmark in example directory).

Following code is basic form:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import yajl.yajl;

// yajl-d can serialize / deserialize D object.
struct Hoge
{
    ulong id;
    string word;
    bool yes;
}

// {"id":100,"word":"hey!","yes":true}
Hoge hoge1 = Hoge(100, "hey!", true);
Hoge hoge2 = decode!Hoge(encode(hoge1));
assert(hoge1 == hoge2);

encode and decode are the wrapper of Encoder and Decoder. If you want to know more details of Encoder and Decoder. See README and the DDoc.

yajl-d has already listed in the official site. Thanks to Lloyd!

Published ‘Introduction to Tornado’ in Japan

| Comments

In the last week, O’Reilly Japan published “概説Tornado”. This is the Japanese translation of “Introduction to Tornado”.

I joined the team as a translation supervisor. Thanks to team members and original authors for the good work.

Tornado is a great product in Python. I use Tornado for the production proxy server and MessagePack RPC backend. Tornado has clear API, clean code and good performance. I think Tornado is good for learning Python and event driven programming.

I hope this book helps your Tornado experience.