D-7 <altijd in beweging>

Day to day life of a Perl/Go/C/C++/whatever hacker. May include anything from tech, food, and family.

2011年03月

(I posted this in Japanese a few days ago. I'm reposting in English... well, because I can :)

So on that day, I was working as usual: With my headphones on, chugging some code. At first I didn't realize that anything was going on - I thought maybe I was making some noises myself. Then I realized that my monitor was shaking. Now there was something going on.

I immediately sent a skype message to a friend living in Iwate -- to which there was no response, because apparently the lines went down over there.

I was in the 25th floor, so things were shaking pretty badly. It was hard to even be standing at times. The building that we can see from our floor was visibly shaking -- it was wobbling (note: most Japanese buildings are made to shake  instead of flat out collapsing). I started sensing this is no ordinary quake.

It took a long time for the shake to subside. Perhaps the ground was fine, but since we were in the 25th floor, maybe the building shook a bit longer.

When things started to calm down, somebody in the office noticed that there was a huge flame towards southeast (note: turns out this was the gas tank in Chiba)

It was obvious something really bad just happened. I was pretty much decided at this point to go pick my wife up and go home ASAP. I started packing, and luckily the we were told pretty quickly that we were free to go home. I said that I'd be leaving to my coworkers, and headed for the stairs.

While I was going down the stairs, I noticed that the paint on the walls had come down from the quake. I was pretty relieved in knowing that the building didn't seem to have any other significant damage. On the way done, I came across a few people actually coming UP the stairs. "I wouldn't do that," I thought, but oh well. I headed out.

There were a lot of people in the lobby. Outside, in front of the building I saw our CEO along with others from work. I guess they were on the way back from their usual late lunch.

I read that the quake took place around 2:46 afterwards. On that day, I had already left work at around 3:10. I knew I was pushing my luck, but I kept calling my wife. Luckily, she was able to pick up the phone pretty quickly. I checked if everything was okay, and told her that I'd be coming to pick her up. BTW, I tried calling my family that day, but wasn't able to reach anybody until later in the night.

I still didn't know exactly how big this earthquake was, so I headed towards the closest station to check out what the status of public transportation was. As I was reaching the station entrance, another big aftershock hit, and people inside the building started running out.

I don't remember how exactly I heard, or decided to myself, but at this point I knew the trains weren't going to move. So I started walking towards my wife's workplace.

On a regular day, it would take about 30 minutes to reach her workplace on foot, but there were crowds of people on the street (note: actually the situation was much better off than what it would have been a few hours later), so it was hard to proceed. There were also areas where the police had shut out people from (for whatever reason -- I didn't bother checking) so I took alternate routes. I felt secure though -- I knew the place inside out, because of the regular Tokyo-walks that I had been taking for years. I knew exactly where I was headed even without a map.

On the way, I found a crowd of people staring at a TV at a store. I glanced and saw the immense tsunami for the first time. "Holy sh*t!". This was not an earthquake. It was a disaster of proportions which I had never seen before. I was so glad that I had the chance to hear my wife's voice earlier. Otherwise I must have felt much much worse. Anyway, the TV image was enough to pick up the pace to my wife's place.

There was a convenience store open on the way. I clapped and cheered inside my head to the owners of this joint, and went to buy a bottle of green tea just in case.

All this time, I'd been checking twitter to find out what the hell is happening. Some people were claiming aftershocks after aftershocks, but I didn't really notice them while I was walking. I also emailed many friends and of course my family on the way.

At around 4:00pm, I finally got to my wife's workplace. Apparently her boss was just about to continue business as usual. Since I didn't want to just burst in, I emailed her from all the addresses I had, to all the addresses she had. Apparently only gmail delivered on time, and she came out of the door. She briefly went back inside to tell her boss that I came to pick her up, and we headed home.

We kept walking, and at around 5:00pm, we realized that we were pretty hungry. My wife apparently got hit by the quake when she started eating lunch. So when we found a noodle shop open on the way, we went in and had a nice, warm meal. God, I love Japanese noodles.

Then we avoided the big streets (for fear of having to walk through big crowds or having something collapse on us), and kept walking. At around 6:00pm, we were getting pretty close to our home. I was relieved to see that things looked normal around there -- I was now confident that infrastructures like electricity and water would be up at home.

Right before we got home, we went into another convenience store, which still had decent supply. Looking back, this was a good decision, as food and water quickly disappeared from the shelves in the coming days.

And we finally made it back. Looking at twitter, my friends are starting to head home themselves. There were a few people walking a really long distance home too. I was so glad to making it home before nightfall.

I actually don't remember much after arriving home. I guess I felt saved. I zapped through the TV, and talked to my family on the phone.

I started receiving replies from people who I sent emails to the next day. They apparently got my email pretty quickly, but their replies just didn't make it to our servers.

And then in the following days my employer told us that we should stay at home and do what we could as far as work was concerned. That lasted for two weeks.

And here I am now.
There's no punchline or dramatic build up in this story. I just wanted to keep a memo of what I went through on that date. Maybe this will of interest to someone.
    このエントリーをはてなブックマークに追加 mixiチェック Share on Tumblr

地震があった時は当然会社にいた。いつも通り適当なDVDを流しながらヘッドフォンをかけて仕事をしていたため最初は全く気づかず、まわりがガヤガヤ言い出して、それでも自分がコードを書きながら足を踏みならしてたせいかと思った。モニターがガタガタ揺れ始めて初めてなんかやばそうな事に気がついてまわりと顔を見合わせた。
揺れに気づいた時に岩手の友達のほうにメッセージを送ったが、届かなかった(あとで確認)。

25階というせいもあり、途中縦揺れが始まると立ってるのも若干辛くなる。座らずにはいられない。目の前に見える野村ビルがプリンのような感じで揺れていると回りの人が言い出して、それを見る。いよいよやばい気がしてくる。

大分長い。いつ終わるんだ。もっとも、揺れていたのは地面ではなくビルかもしれないが。

だんだん落ち着き始めた頃、遠くのほうで赤い炎が見えた。誰かがあれはお台場のほうだと言う。

さすがにこれはやばいのは誰の目からみても明らかだったのでその時点で誰になんと言われようと妻を迎えに行って家に帰ることに決めてた。まだ若干揺れていたが、手早くいつも通り片付けを始め帰る準備は万端。ラッキーな事にうちの会社は比較的すぐに帰って良い事になったため、回りに軽く声をかけて階段に。

17、8階までおりたあたりで元々そうだったのかどうか知らないが、壁の塗装がはげてるのが見える。これくらいならこのビルは大丈夫だな、と思いつつさらに下へ。上にあがろうとしている人もいるが、正直「今から外に行くならともかく上がるなんてどういうことだ」と思いつつ外へ。

ロビーではたくさんの人がガヤガヤと集まっていた。会社の前の広場では社長を含めて数人がいる。いつもの遅い昼食に行っていたであろう同僚達だろう。

後から調べたところ地震があったのは2時46分だという。3時10分すぎには会社を出ていた。途中埒があかないなーとは思いつつも妻に電話をかけ続ける。会社を出たところで奇跡的に1回繋がり、手短に彼女の安全を確かめた後、迎えに行くからそこにいるよう伝える。その後は夜になるまで妻は当然のことほかの誰とも電話は繋がらなかった。

その時点ではまだどれほどの地震だかわからなかったのでとりあえず新宿駅へ向かって、鉄道がどういう状態なのか見てみようとした。さすがに騒然としている。いつものJRの改札のあたりにさしかかるところで余震。かなり揺れて、駅の中のほうから人がかけだしてくる。

もう混乱しててどこでそう読んだのか、そう確信したのかわからないが、電車が動かなさそうと判断したので、妻の会社方面まで移動。

いつも都内ハイキングと称した散歩をしていてよかった。まったく迷う気がしない。普通の日だったら30分でつく距離だが、さすがに人が多くて進みづらい。途中代々木駅あたりで道が通行止めになっていた。なんでかは全然わからなかったが、ちょっと迂回しててくてく歩く。

途中どこかの店先でテレビに食い入るように見入る集団を発見。ちょうど津波の映像が流れているところだった。ここで初めて「こいつは*本気で*やばい」と思い始める。その時点で妻の声をすでに聞いてなければかなり焦っていたことだろう。とにかくこれで多分交通網は絶望的だからとにかく早い内に帰ろうと余計に決心した。

途中どこかのファミリーマートでお茶を一本購入。店の人達偉い!と思いつつさらに移動。この間ずっとtwitterで状態を確認しながら歩いている。余震の発言とかも見るが歩いているのでよくわからない。あとは知り合いや家族にメール。

歩いている人が実はこの時点で大分少ない。みんなどちらかというとぼーっとしてる感じ。

4時過ぎ、ようやく妻の会社前に到着。自分の持ってる全てのメールアドレスから、妻のもってるありとあらゆるメールアドレスにメールを送信。gmailだけが届くと妻が外に出てきた。妻の会社は下手するとそのまま営業を続行しそうな感じだったらしく、「旦那が来たから帰る」と言って二人で移動。

そのまま歩き続ける。5時過ぎに腹が減ってきた。妻もランチ中に地震があったらしくご飯をまともに食べていなかったらしく同意。でもさすがに俺にいつもつきあって歩いているだけあって、足取りは全く持って普通。いつも横を通るところにある蕎麦屋が営業していたのでそこでさくっと温かい蕎麦を。五臓六腑にしみる。

その後は大きい道を避けて歩く。6時ちょっと前にやっと家の手前に到着。もうここまで来て町並みが被害を受けていないならうちも大丈夫だろうと安心する。あと電気がついている家もちらほら見受けられたので停電もないという確信があった。

家に行く手前でいつも行ってるコンビニに寄った。もうすでに品薄になり始めてたが、まだまだ十分に色々とあったので、おにぎりを二個ずつ、ポテトチップとかの乾き物を少量、それに飲み物をちょっと購入。後から考えるとこの判断も正しかった。

6時ちょうど頃家に着く。twitterとかを見てるとボチボチ帰宅難民の人達が本気の悲鳴を上げ始めている。もちろんすでに大分前から遠距離を歩いてる猛者もtwitterで見てた。日が暮れる前に家にたどり着けて本当に良かった。

家につき、安堵したのか、とりあえずここから先はあんまり記憶に残ってない。テレビを見たり、twitterを見たり。

家族にはその晩連絡がついて、無事を知って安心。

それ以外の人達は翌日の夕方になってメールの返信が届き始めた。みんな俺のメールは比較的早い内に受け取っていたみたいだけど、返事が全然こちらに来ていなかった。

土日があって、次の日からは自宅待機。ある時点からは出社禁止。そしてようやく次の月曜から出社。

というわけでとりあえず 3/11の記憶を記録してみた。特に落ちはない。



    このエントリーをはてなブックマークに追加 mixiチェック Share on Tumblr

DSC_0006.jpg
まぁそんなわけで久しぶりにdocomoユーザーになったでござる。画面は正直iPhoneより全然美しい。日本語入力もATOKを使えるので大分良い感じ。

写真は今日築地に遊びに行った際に小田保さんでブランチで食べたアジフライ定食をXperia arcで撮影したもの。Macを母艦としてるのでやっぱりiPhoneのようなタイトなインテグレーションは望めないが、まぁそこはdropboxとかを駆使すれば特に問題はなし。音楽はもともとこういう機械では聞かないし。

本当はPocket Wifi的なものも欲しかったんだけど、あれってやっぱり別途回線契約必要なのよね(?)もうFOMA回線があるんだからそれを使わせてくれればそれでいいのになー
    このエントリーをはてなブックマークに追加 mixiチェック Share on Tumblr

ちょっとだけ躓いたりしたので、備忘録のため。AnyEventでData::MessagePackを受け取るサーバー
use strict;
use AnyEvent;
use AnyEvent::Socket;
use Data::MessagePack;
use Data::Dumper;

main();

sub main {
    my $host = undef;
    my $port = 8888;
    my $guard = tcp_server $host, $port, sub {
        my ($fh) = @_;
        handle($fh);
    };

    my $cv = AE::cv;
    my $w; $w = AE::signal 'INT' => sub {
        undef $w;
        undef $guard;
        $cv->send;
    };

    $cv->recv;
}


sub handle {
    my $fh = shift;

    my $packer = Data::MessagePack::Unpacker->new;
    my $buf = '';
    my $offset = 0;
    my $w; $w = AE::io $fh, 0, sub {
        my $n = sysread $fh, $buf, 65536, length $buf;
        if ( $n == 0 ) {
            undef $w;
        }

        while (length $buf > 0) {
            $offset = $packer->execute( $buf, $offset );
            if (! $packer->is_finished) {
                last;
            }

            warn Dumper( $packer->data );
            substr( $buf, 0, $offset, '' );
            $offset = 0;
            $packer->reset;
        }
    };
    my $s; $s = AE::signal INT => sub {
        undef $w;
        undef $s;
    };
}
適当なクライアントスクリプト
use strict;
use Data::MessagePack;
use AnyEvent;
use AnyEvent::Handle;
use AnyEvent::Socket;
use AnyEvent::Util;
my $count = shift @ARGV || 100;

my $cv = AE::cv;
my $w; $w = tcp_connect '127.0.0.1' => '8888' => sub {
    my $fh = shift;

    AnyEvent::Util::fh_nonblocking($fh, 1);
    my $i = 0;
    my $h = AnyEvent::Handle->new(fh => $fh);
    my $next = sub {
        $cv->begin;
        $h->push_write( Data::MessagePack->pack({ foo => $i }) );
    };

    $next->();
    $h->on_drain(sub {
        my $h = shift;
        $cv->end;
        if (++$i < $count) {
            $next->();
        } else {
            undef $w;
        }
    });
};

$cv->recv;
    このエントリーをはてなブックマークに追加 mixiチェック Share on Tumblr

このページのトップヘ