blog.8-p.info

Q4 ふりかえり

Dec 27, 2017

10月

  • MacBook Pro を買った。個人で使うコンピュータに “Pro” は贅沢だろうと今まで避けていたんだけど、いまは MacBook Pro も MacBook も値段が変わらず、速さと軽さだったら前者のほうが重要なので Pro にした。
  • Hacktoberfest 2017 に参加して、無事に T シャツをもらった。
  • 会社から家への帰り道を走るのを続けていた。
  • なんとなく Duolingo を再開した。

振り返ると、英語のブログもよく書いていた。

11月

  • 娘が生まれてから1年間だけとれる育休がまだ余っていて、かつ妻の友達の結婚式が大阪であるというので、ほぼ1ヶ月会社を休んで、うち2週間は日本に帰っていた。
  • ミクシィとメルカリを起点に、昔の友達や同僚にたくさん会えた。

メルカリ、行くたびに昼食を奢ってもらっているので、そろそろ誰か人を紹介しないといけない。私はまだシアトルにいるつもりだけど、六本木やサンフランシスコで働きたい人は是非。

12月

11月の末に「週3でブログを書くぞ」と決めてなんとかやりきった。

むかしに読んだ『レバレッジ勉強法』でも、あるいは higepon さんの 勉強方法を勉強して分かった僕に足りなかった3つのこと にもあるけれど 1

勉強をコンスタントに長期的に続けるならば時間割は大変有用。

時間割を作り実践してみて分かったが「次に何をやるべきか」に迷う時間は振り返ればとてももったいなかった。

迷いがなくなるのと「ここにもう少しあの話を足してから公開しよう」みたいな細かいこだわりで結局なにも公開までたどりつかない、というのが減らせのは良かった。

仕事

ずっと新しいプロジェクトの設計めいた仕事をして、最近になってやっと実装にはいった。ちょっと設計に時間をかけすぎた気もする。下手に言語化しないの、

俺は手戻りを一切恐れてないので、細かく仕様詰める無駄な時間を過ごす間に3回作って捨てる

というのは眩しくて良かった。

勉強

また iKnow + Duolingo という組み合わせに戻った。Duolingo では中国語とスペイン語もはじめたけれど、実際にやるのは英語に偏りがち。

あと、久しぶりの論文ブームが来つつある。

家族

娘は1歳になった。なんの支えがなくても突然立ったりするし、手を引いてあげれば歩けるようになった。

インターネット

Twitter をしたりブログを書いたりしていた。


  1. そもそも higepon さんの記事を読んで『レバレッジ勉強法』を読んだ気もする。 ↩︎

@hardmaru さん経由で、Making Peace with Personal Branding を読んだ。Twitter にすら力を入れていて

I use twitter primarily as a professional tool (I think of it as a more dynamic version of LinkedIn), so I try to keep most of my tweets related to data science. If your goal is personal branding or finding a job, I recommend keeping your tweets mostly focused on your field.

といってしまうところ、TEDx で話すまえに

I was terrified, so I started working with a public speaking coach in preparation, and it was super helpful.

といってパブリックスピーキングのコーチをつけるところ、ブログについて書いているところなんかが印象に残った。著者の Rachel さんは Why you (yes, you) should blog とブログだけに焦点を絞った記事も書いていてる。

と、それとまた別経路で 10 years of professional blogging – what I’ve learned も読んだ。

That’s why I refuse to write on Medium or Quora. Instead, I prefer to run open source software that I can move around, prioritize building my email list (more on that later) and try to keep regular backups. I used to write on Blogger and watched them slowly stop maintaining the platform after the Google acquisition. Then I switched to Typepad, only to watch the same thing happen. I learned my lesson.

というのは同世代感があって良い。著者の Andrew さんは How to start a professional blog: 10 tips for new bloggers というのも書いていて、これも実践的で良かった。

英語でブログを書くの、たまにやってみてはあまり続かずに日本語に戻ってくるのを繰り返しているけど、それでも2011年とか2013年とかはがんばっていた。さらにいうと、昔に書いたソフトウェアはがんばって英語ページも作っていた。

来年は、そういう初心を忘れずに、もうちょっと日本語圏の外に届く活動ができればなあと思う。

今日に聞いた Planet Money は、2015年の再放送で、サンタスーツと関税の話だった。

サンタのコスチュームは通常は催事用のもの (festive articles) という扱いになって、外国から輸入する際に関税がかからないんだけど、しっかりした作りのものは洋服扱いになって、高い関税がかかってしまう。

And customs looks at this nicer Santa suit and says to Marc - this is not a festive article. You made this so nice this is clothes. And clothes go under a different part of the tariff code. To import this suit, Marc has to pay a 32 percent tax on the jacket and a 29.2 percent tax on the pants.

という件で Rubies Costume Company というコスチュームの販売会社の人が政府に対して訴訟を起こしていたらしい。ちょっとのネタバレになってしまうけど、面白いのは、この人は以前は国内生産のサンタスーツを売っていて

Back in the ‘90s, on the other side was Marc Beige, was Rubie’s Costume Company. He has completely switched sides.

そのときはサンタスーツは洋服であるので関税をかけるべきだ、という立場で訴えを起こしていたらしい。

Planet Money とは

Planet Money は NPR (National Public Radio) がやっているラジオ番組で、私はポッドキャスト経由でたまに聞いている。お金にまつわることを中心に、いろいろなテーマを取り上げていて面白い。

今年に聞いたものだと

  • North Korea’s Capitalists: 北朝鮮はミサイルをどう買ったのか? という疑問を導入に、ドンジュとよばれる資本家/起業家的な人々や、その育成プログラムについて。
  • The Basic Income Experiment: ベーシックインカムの試みと、フィンランドでの実験と、デザイン思考について。
  • Shrimp Fight Club: アメリカにおける事業仕分けと、そこで「えびファイトクラブ」と名指しされ研究の意義を問われた科学者のはなし。

ここらへんは特に面白かった。英語を聞くだけでは辛いという人には Transcript もあります。

最近は Lombok 以外にも色々あるみたい。

AutoValue

Google の人々が開発していて、google-java-format と同じように、設定できるところがあまり無い。出来る/出来ないことについて opinionated で、理由を読んでみると勉強になる。

一方で、AutoValue with Builders

As explained in the introduction, the AutoValue concept is that you write an abstract value class, and AutoValue implements it. Builder generation works in the exact same way: you also create an abstract builder class, nesting it inside your abstract value class, and AutoValue generates implementations for both.

というように Builder は生成してくれなかったり、インターフェースから生成はできないの? という問いに

Interfaces are not allowed. The only advantage of interfaces we’re aware of is that you can omit public abstract from the methods. That’s not much.

と冷たく突き放してみたりで、お前はボイラープレートを減らしたいんじゃなかったのか、と存在意義を問いたくなるところもある。

Immutables

名前に “Immutables” とある割になぜか mutable なものも生成できたり、@Value.Style で色々設定できたりと、とにかく節操がない。

The Morning Paper で紹介されていた論文を読んでいる。全体像について書くと The Morning Paper の翻訳になってしまいそう1なので、個人的に見所だったところだけ紹介。

スマートフォン時代のクライアント

SVE は動画を GOP (group of pictures) という短い動画に変換して扱っていて、その分割はクライアントの側で行われている。

The first change is that the client breaks the video up into segments consisting of a group of pictures (GOP), when possible, before uploading the segments to the front-end. Each GOP in a video is separately encoded, so each can be decoded without referencing earlier GOPs.

GOP 分割は必須ではなくて、古いクライアント向けにはフォールバックも用意されている。

Some older clients cannot split videos into GOP segments before uploading. The preprocessor does the GOP splitting for videos from those clients.

さらにクライアントは動画の再エンコードさえすることもある。

We decrease the latency for uploads through client-side re-encoding of the video to a smaller size when three conditions are met: the raw video is large, the network is bandwidth constrained, and the appropriate hardware and software support exists on the client device. We avoid re-encoding when a video is already appropriately sized or when the client has a high bandwidth connection because these uploads will already complete quickly. Thus, we prefer to avoid using client device resources (e.g., battery) since they will provide little bene t. Requiring all three conditions ensures we only do client-side re-encoding when it meaningfully decreases pre-sharing latency.

私はいまだに「クライアントは非力で API も少ないし、色々複雑な作業はサーバー側でやったほうが、エラーもログも簡単に収集できるし平和だよね」というクライアント == ブラウザ時代の空気感を暗黙の前提にしてしまいがちで、SVE のクライアント == スマートフォンむけに Java/Objective-C や C++ で書かれているソフトウェアが頑張る感じは新鮮だった。

HHVM と Hack

Facebook でも、こういうバックエンドのシステムだったら Hack とか使わずに Java なり Python で書くのかな、となんとなく思っていたら

All workers are equipped with HHVM, a virtual machine supporting just-in-time compilation for all SVE tasks, which in turn are Hack functions deployed continuously from our code repository. During execution, each task is wrapped within framework logic that communicates with SVE components to prepare input, propagate output, and report task results.

普通に HHVM + Hack で動いているらしい。”Hack functions deployed” なんて言い回しはちょっと AWS Lambda っぽくもある。

To be shared

論文全体に渡って

Uploading and processing are on the path between when a person uploads a video and when it is shared. Lower latency means users can share their content more quickly.

“used” みたいなぼんやりした動詞ではなくて、ずっと “shared” を使っているのも印象的だった。

Taken together, these improvements enable SVE to reduce the time between when an upload completes and a video can be shared by 2.3x-9.3x over MES.

単純に「シェアできる状態になる」というのが全体のパイプラインのうち重要なマイルストーンなのかもしれないけど、サービスを特徴づける動詞があって、それをエンジニア側もメトリクスとして使っている、というのは、なんか会社としてちゃんとしていて良いなあと思う。


  1. 翻訳を読みたいひともいるかもしれないけど、プログラマと英語 1: 野良翻訳で書かれている色々に同意する部分もあり、自分では翻訳しません。 ↩︎