Soramichi's blog

Some seek complex solutions to simple problems; it is better to find simple solutions to complex problems

異文化コミュニケーションについて

みなさんこんばんは。Microsoft Research Internship アルムナイ Advent Calendar 2020 の19日目です。最近ネット界隈から離れているので世間の様子が分からないのですが皆さんいかがお過ごしでしょうか?

こういう真面目なカレンダーに参加する度に同じようなことを書いている気がしますが、今回もまた異文化コミュニケーションについて書きたいと思います。研究の話はすでにいろんな人が書いているのでそちらに譲りましょう(これも毎回言っている気がする)。MSR には直接関係ない話になってしまいますがご了承ください。まぁ特定の会社の宣伝をするのもあまり良くない気がするのでこれでいいでしょう。あ、ちなみに4年前に ACM Ditital Library で研究機関ごとの平均被引用数を調べたときは MSR の論文は平均 34.2 回引用されていたようです。

今回(も)伝えたい内容ですが、いつもと同じで「せっかく留学するなら研究・勉強だけじゃなく現地で積極的に異文化コミュニケーションをしよう!頑張ってするといいことがあるよ!」です。 メッセージはいつもと同じなのでなんだつまらんなという感じなのですが、今回のポイントは自分以外の体験談を集めてきたことです。

集めた体験談を紹介する前に、過去に自分が同じようなことを書いたエントリたち(これらは自分の体験談のみ)を貼っておきます。

それでは本題の異文化コミュニケーションについての体験談を紹介していきます。

体験談 1:博士課程でアメリカに留学した某氏

英語を上手に話せる必要はないことを学んだ。様々な国から人が集まるアメリカでは正しく完璧な英語を話せない人が多い。なので英語が下手な人と会話することにほとんどの人が慣れている。周りのほとんどが日本人で上手な日本語を話せることが当たり前の環境で育ったことが,下手な言語を話すことへの抵抗感を大きくしていたことに気づく。抵抗感を取り除いて,思うままに話すようにすれば仲良くなれるし上達するし一石二鳥

体験談 2:修士課程でオンライン国際会議の student volunteer に参加した某氏

I joined a 'Meet The Speakers' session where students can talk with professors or other students. During the session, I met a professor who happened to be a colleague with someone who mentored me when I was an undergraduate student. After we found that we know some mutual friends, this professor gave me a lot of advice about working in the academic community and PhD application. The impression is that the academic community is a quite small but tight community. And people are friendly and willing to give advice to others. And you can learn a lot from someone who has totally different background with you.

体験談 3:博士課程でイギリスに留学した某氏

イギリスのヨーク大学に滞在中、お世話になった研究室でよく一緒に居たのはベルギー人とメキシコ人でした。最初はお昼ご飯を一緒に食べましたが、その時間は1時過ぎ。その後も何度かご飯を食べたのですが、そもそもお昼を食べないこともなかなか多かったです。不思議そうにしてるとメキシコ人の方から「メキシコではそもそもお昼ご飯の時間が15時とか16時で、そこでめいっぱい食べるんだ。だからこの時間にはあまり食べないんだよ」と教えてもらいました。国が違えば朝昼晩の感覚も違う。自分の常識は他人の非常識と再認識した瞬間でした。

いかがでしょうか?体験談 1 と 2 は異文化コミュニケーションは怖くない、有益だという内容で、体験談 3 は異文化コミュニケーションで視野が広がったと内容で、どれも本当にその通りだと思います。 また体験談 2 はオンライン国際会議の中での話ということで、なかなか実際に海外留学することが難しい中でも異文化コミュニケーションを取ることはできるんだといういい例だと思います。

完全に MSR とは全く関係ない話になってしまいましたが、海外留学つながりということでこれでご容赦ください。それではまた。

Contribute to be contributed

前置き

研究留学 Advent Calendar 2019 - Adventar の21日目の記事を1か月遅れで投稿します。

今回はスイスの ETH Zurich にちょうど半年間(2019年4月6日〜2019年10月6日)滞在しました。 最初にスイス行く際に入国書類で詰みかけた話、物価がやたら高くてびびった話、スイスのドイツ語が普通のドイツ語とかなり違う話は下の3記事に書いてあります。

sorami-chi.hateblo.jp

sorami-chi.hateblo.jp

sorami-chi.hateblo.jp

本題

今回の記事で伝えたいのは、 "Contribute to be contributed" ということです。分かりやすく言うと、滞在先で積極的に contribute するとその後自分に返ってきて嬉しいぞ、ということです。別な言い方をすると、短い滞在期間で目先の成果を出す以外にも将来に繋がるコネクションづくりをすべきではないか?ということです。積極的に contribute していれば多くの人と議論する機会が増え、帰国後に特定の research topic について議論や共同研究をしたり、論文を書く際にコメントを貰うことがとてもやりやすくなります。すると例えば半年間の滞在でその後何年も役立つ(かもしれない)協力関係を築くことができます。せっかく行ったのにチームの他の人が何をしていたかよく知らない、自分が何をしていたかも知られていない、ではもったいないです。

「コネクションを作る」というと苦手意識がある人もいるかもしれませんが、お互いに研究者なので普段の研究活動で contribute していれば自然とコネクションはできます。具体的には以下のようなことです。

  • seminar や reading group で積極的に質問する。最初は気恥ずかしいかもしれませんが3回目くらいで慣れます。
  • seminar で積極的に発表する。滞在最後の発表はだいたい要求されるかと思いますが、滞在の最初にもチャンスがあれば今までどんなことをしてきたかを発表させてもらいましょう。
  • 1 vs. 1 の議論を積極的に行う。特に「滞在最初で自分が何をやるかまだ具体的に決まっていない時」と「自分より後に新しく来たメンバーが何をやるかまだ決まっていない時」がチャンスです。滞在先のボスだけでなくなるべく多くのメンバーと議論しましょう。
  • Slack などで議論があれば思ったことを積極的に発言する。例えば "why?" とか "which paper?" などの簡単なものでも、そこから議論に発展した場合に中に入りやすくなる効果があっていいと思います。

前回の記事

今回はどうやって contribute して将来に活かすかを書きましたが、前回(海外留学を楽しくするコツ - Soramichi's blog)は「海外留学でどうやって友達を作るか」を書いています。興味があれば参照してください。

ドイツ語の壁について

壁 Advent Calendar 2019 - Adventar20日目です。

今年の4月から10月までスイスのチューリッヒに滞在していたので、そこで話されているドイツ語の壁について書きます。スイス入国時に直面したやばい壁については下記の記事をご覧ください(ヨーロッパに長期滞在する人には役立つ内容かと思います)。

sorami-chi.hateblo.jp

ドイツ語の壁とは

チューリッヒではドイツ語が話されていることになっていますが、実は Swiss German というやつで普通のドイツ語とはかなり違うところがあります。この記事では Swiss German と普通のドイツ語の違い(壁)について書きます。

半年間の観測では、Swiss German の単語で普通のドイツ語と異なるものには3つのパターンがあるようです。

  • パターン1:フランス語の影響
  • パターン2:特定の文字が変わる
  • パターン3:完全に独自の用語

パターン1:フランス語の影響

スイスではドイツ語の他にフランス語圏、イタリア語圏、あとほんの一部ロマンシュ語が話される地域があります。ロマンシュ語以外の3つは公用語になっており、スーパーで物を買ってもだいたいドイツ語、フランス語、イタリア語で成分などが書いてあります。

この影響かは裏をとってないのですが、Swiss German にはたくさんのフランス語の単語が溶け込んでいます。例えば次のようなものがあります。

  • Poulet - チキンです。スーパーにおいてあります。完全にフランス語の単語です。google translate で chicken と入れると Hähnchen と出ますが、チューリッヒでは見たことがありません。
  • Coifeur - 美容院です。Herren とか Damen とか書いてあります。これも完全にフランス語のようです。
  • Excüsé - Excuse me です。発音はエクスキューゼーなのでフランス語の Excusé moi に近いです。ただし entschuldigung も普通に通じます。

また Swiss German ではエスツェット(ß)を使いません。例えば駅前通りは Bahnhofstrasse となり、Bahnhofstraße ではありません。これもフランス語とかイタリア語にないアルファベットは使わないから、ということでフランス語の影響という説がありますが実際のところはよくわかりません。

パターン2:特定の文字が変わる

普通のドイツ語と比べて特定の文字が変わることがあります。よくあるのは au が üu になるパターンです。例えば Haus が Hüus になって、スーパーで Hüus Tea というのが売っています。

パターン3:完全に独自の用語

上のどちらのパターンにもあてはまらない、完全に独自の単語やどう変化したのか分からない単語もたくさんあります。

  • Grüezi - 軽い挨拶で、Hi みたいなものです。どこでも何時でも使いまくります。たまにとてもカッチリしたところ(空港とか)に行くと Guten Tag とか言われるのでびっくりします。
  • En guete - have a nice meal 的な意味です。例えばレストランで食事を出すときなどに言います。発音は エン グワッテ です。
  • Schoggi - チョコレートです。普通のドイツ語では Schokolade なので似てはいますが、かなり形が違うのでどう変遷してきたのかよくわかりません。

City of Berkeley will use gender neutral languages

According to an article in San Fransisco Chronicle, the city of Berkeley, CA, USA, will "replace gendered language in the city’s municipal code with neutral terms" as "an effort to be more inclusive". The article provides a link to what seems like the official document of the city, where the new municipal code with the edit history begins from page 4.

This is truly a big step for real inclusion, because they do not say anything like that they will include both men and women, but they say they will go "gender neutral". From page 6 of the document, the list of words / phrases to be placed and how to place them are shown, among which there are a couple of outstanding ones:

  • "Fireman", "Firewoman", "Foremen" and "Firewomen" to be replaced by "Firefighter" or "Firefighters"
  • "Male and female" to be replaced by "People of different genders"
  • "Men and women" to be replaced by "People"
  • "The masculine pronoun includes the feminine" to be replaced by "Words referring to a specific gender may be extended to any other gender"

These policies prove that they really try to be neutral, with non-majority people truly taken into account.

In contrast, in many so-called "equality" or "diversity" acts, they assume that there are only "he" and "she", or "male" and "female", and the association between biological sex and cultural gender is always the same as what they assume.

This is not only wrong and doesn't help minority people, but it also sometimes amplifies existing discrimination. For example, many people believe that adding a women into a men-only team (or the other way around, adding a man into a women-only team) is THE best thing for diversity. However, this relies on an assumption that the added woman (or man) has different way of thinking than the existing members, which stems from another assumption that the existing men (or women) have similar ways of thinking just because they have same biological sex. This is nothing but discrimination!

Another example might be these "women in XX" or "XX for girls" events, where the organizers often associate the biological sex of the participants and cultural biases generated by discrimination. For example they often say like "different way of thinking that women have", or they use pink color which they never use in any of their other events. Although these things might comfortably be accepted by "normal" people who were born as women and are happy to be "female", they are perfect discrimination which never achieve true inclusion (please carefully note, that I'm not saying that supporting discriminated people is bad, but what I'm saying is that these "supports" sometimes amplify discrimination if they are not well-considered).

"Inclusion" should be "we don't care whoever you are or whatever way of thinking / characteristics you have", but should not be "we only accept those who we are comfortable with".

Anyway, the step taken by the city of Berkeley is a very big deal, and I hope other cities, states, and countries will follow it soon.

How to Install Acroread into 64 bit Debian

I like Evince because it works very well in most of the cases and it's very lightweight, but there are some cases where I still need a pdf reader from Adobe, for example when I have to check a pdf with annotations.

Although Adobe does not provide Acroread (a.k.a. Acrobat Reader) for Linux anymore, it somehow still hosts .deb files of old versions and you can install them into modern distributions as well.

Download an old version

$ wget http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb

Allow 32 bit debs to be installed

In the default configurations, a 64 bit version of Debian does not accept 32 bit deb files. Enable multiarch support to install 32 bit debs.

$ sudo dpkg --add-architecture i386
$ sudo apt-get update
...
$ sudo apt-get upgrade

Install Acroread deb and dependencies

Install the .deb file downloaded from the adobe website. Execute apt-get install -f after that to automatically install dependencies.

$ sudo dpkg -i AdbeRdr9.5.5-1_i386linux_enu.deb
$ sudo apt-get install -f

You can now run it with the acroread command. In some case, it may yield an error due to lack of some libraries. You should install the 32 bit version of the required library by adding :i386 suffix to the package name.

$ acroread
# an error may happen requiring libxml2 (or whatever other libraries)
$ sudo apt-get install libxml2:i386     # don't forget to add ':i386'!
...
$ acroread
# should work

Some tips to simulate cache behaviors using Intel PIN

I've been working on simulating behaviors of CPU caches using Intel PIN, and faced some tricky things. This post gives ideas on what kind of troubles you may face and some hints to solve the issues.

I used Cache Pintools as a basis and expanded it to really read/write cached data from/to memory (the original version only counts the number of cache misses). However, I believe the same things apply for any other cache simulation code.

Always use PIN_Safecopy() to access application memory

PIN can actually access to the application's data using raw pointers. For example, the code below does work.

VOID InterceptMemRead(VOID* addr) {
    *(int*)addr = 0; // overwrite the data pointed by addr by 0
}

VOID Instruction(INS ins, VOID* v) {
  if (INS_IsMemoryRead(ins)) {
    INS_InsertPredicatedCall(
                ins, IPOINT_BEFORE,  (AFUNPTR)InterceptMemRead,
                IARG_MEMORYREAD_EA,
                IARG_END);
    }
  }
}

int main() {
  ...
  INS_AddInstrumentFunction(Instruction, 0);
  ...
}

If you simulate reads/writes of caches from/to memory, you may need to read somewhere outside of legal address ranges. For example, if the target address of a load is 0x123456, the starting address of the cache line that includes the data is 0x123440 (assume that a cache line is 64-byte long).

Using PIN_Safecopy() solves this issue by guaranteeing a safe return:

The function guarantees safe return to the caller even if the source or destination regions are inaccessible (entirely or partially).

Some instructions implicitly touch memory data

There are some instructions that do not have memory operands as their explicit arguments but do write to/read from memory. Namely, push, pop, call and ret. Note that a call writes the return address to the stack, and a ret reads the return address from the stack.

Therefore, you should NOT write code like

if (INS_IsMemoryRead(ins) &&
    INS_OperandIsReg(ins, 0) &&
    INS_OperandIsMemory(ins, 1)) {
  INS_InsertCall(...);
}

as tools/source/ManualExamples/safecopy.cpp does. You should only use INS_IsMemoryRead(ins) to detect memory loads in order not to miss these implicit memory operations.

Do not use system calls when cache simulation is enabled

This was the thing I spent most of my time to debug. The situation was that my program looked reading some data that it had never written. It turned out that the data was written by system calls, which PIN cannot instrument.

PIN cannot instrument inside system calls by nature because how it works is that it adds some code to the binary of the target application when the application is loaded into the memory space. The executable of system calls (more precisely, the executable inside the OS kernel, but not the wrapper functions of system calls inside libc) is loaded at the boot time of the OS, and there is no chance for PIN to instrument it (it neither has a privilege to do so I guess).

Therefore, if a system call is called, you never know which memory page it reads from/writes to. This is not a serious problem if you only count the number of cache misses, assuming that system calls you use do not pressure the cache that much. However, in order to simulate reads/writes of caches from/to memory, even a single bit of data written by a system call will result in data inconsistency.

A possible way of solving this is to define region(s) of interest inside your program, enable tracking only inside the region(s), and never use system calls inside them. This could be done by adding effect-less pieces of binary at the beginning and the end of your regions of interest and let PIN use them as triggers. Be careful that recent gcc is too clever to delete effect-less binary even if you inject it with asm volatile. In my case, adding a special value to a register and then substituting the same value immediately after it survived gcc optimizations even with -O3.

スイス(チューリッヒ)の食費とスーパー事情

チューリッヒに来て2週間経った。今までに分かっているところでチューリッヒの食費事情を日本より安いものあまり変わらないもの日本より高いもの に分けてまとめる。なおスイスでは物価がそもそも高いので、下で「安い」か「同じくらい」と書いていないものは「高い」に入れていなくても基本的に全て高いと思ってもらえばよい。

来るときの紆余曲折については過去記事を参照(次回入国についてはまだ解決できていない)。 sorami-chi.hateblo.jp

日本より安いもの

チーズ

チーズの種類にもよるが、ものによっては日本の数倍安い。例えば COOP というスーパーでは 300 g のカマンベールチーズが 1.85 フラン(200円ちょい)で売っている。 日本でスーパーに行かないのであまり日本のチーズの値段が分からないけど、雪印のカマンベールチーズが Amazon で 100 g で 450 円だったので、それより6倍安い!日本に住んでいるヨーロッパ人が「日本のチーズは高すぎる」と言っているのを聴いたことがあるけど、なるほど確かにという感じである。

パン

パンも日本より少し安い。パンといっても加工されたサンドイッチ等ではなく、でかい塊のまま売っているものである。これも種類によるが、一番安いものだと 400 g の塊で 2 フランくらいで買える。

水は安いというより「買わない」が正しい。東京だと水道水が美味しくないのでミネラルウォーターを買っている人が多いと思うが、チューリッヒでは湧水やアルプスの雪解け水?がとても綺麗なので、みんな水道水を飲んでいる。職場や外でも再利用したペットボトルとかタンブラーに水道水を(トイレの水道とかから)補充してみんな飲んでいる。

あまり変わらないもの

ペットボトルのジュース

コーラとかファンタとかスイスオリジナルの Rivella というジュースは、500 ml ペットボトルがスーパーで 1.3~1.5 フランで買える(まとめ買いするともっと安い)。日本のコンビニで 150 円くらいなのでほぼ同じくらいである。

ただし、空港や動物園などの観光地価格では異常に高くなる。日本だと観光地価格でも 150 円が180円とか200円になるくらいだと思うが、空港や動物園ではコーラ 500ml が 3.5 フランとかで売っていたりする。

果物

これも物によるが、(スイス基準で)安いものは日本とあまり変わらないように思う。例えばブドウ 2 房(300gくらい?)が3フランくらいだった。しかしリンゴは小さいのが1個で 3.5 フランとかなので高いものは高いようだ。スイスはワインもたくさん作っているらしいのでブドウは安いのかもしれない。

日本より高いもの

外食

外食は異常に高い。こちらの友人の話によるとスイスでは人件費がめちゃくちゃ高いので「調理してもらう」「サーブしてもらう」ことで高くなっているらしい。だいたい1フラン=100円だと思って日本の2倍くらいの値段である。実際には1フランはほぼイコール1ドルなので100円より高いこともある。

例えばチューリッヒに来た次の日に友人と3人で中心街のレストランで bratwurst というソーセージを食べたのだが、ソーセージ + つけあわせのパスタ + ドリンク で3人で 77 フランだった。1人約 25 フランとして、25フランを2500円だと思ってさらに2で割るとちょうどいいくらいの値段である。

f:id:sorami_chi:20190421031942j:plain

また hauptbahnhof(中央駅)のバーガーキングではワッパーのセット(ワッパー、ポテト、ジュース)が 15.9 フランだった。日本のバーガーキングでは 840 円らしいのでこれも 1 フラン = 100円と思ってさらに2で割ると日本の値段くらいになる。

日本食

日本食は普通の外食よりさらに異常に高い。例えば zurich ramen で検索すると出てくる店では担々麺が 24 フランと書いてある(高すぎて行っていないので味は分からない)。また Izakaya では Edamame が 6 フランとかで出てくるようである。

またスーパーでパック寿司などを売っているがこれもめちゃくちゃ高い。例えばマグロとサーモン2貫ずつ(計4個)と鉄火巻きのパックが 13 フランなどで売っている。スーパーで売っている寿司がどんな味がするか試しに買ってみたいのだが、あまりにも高くてまだ挑戦できていない。

スーパー事情

チューリッヒにはおもに COOP と Migro という二つのスーパーがある。COOP の方がたくさんあって、多いところでは二つの COOP が100メートルくらいしか離れていないこともある。朝7時からあいているので朝食を買うのにもよい。また COOP の方が賞味期限が近いものを安売りしていることが多い気がする。別に夜遅くではなくても 50% オフのソーセージが置いてあったりするので、これで食費を節約できる。

スーパーでは有人レジと無人レジがあって、日本とは違って無人レジをみんなちゃんと使っている。日本のコンビニだと有人レジは並んでいても無人レジは誰も使っていないことがあるが、それとは違うようである。基本的に全てクレジットカードで払うが、アメリカであるような "cash back" (Nドルの買い物に対して N + M ドルをカードで払って、余分の M ドルを現金でもらうことで ATM に行かなくても現金が手に入る)はできないようである。