2018/09/30

ZenIT Workshop: AI Government

Today, I paired in ZenIT style with Masashi Dojo, a Japanese programmer living in Katsuyama, Fukui with 10 years of experience in mobile apps and testing.
今日は道場という日本のプログラマーとZenITスタイルのペアプログラミングを行いました。彼は福井県勝山市にすんでいる、モバイルアプリとテストの経験があるプログラマです。


We did Zazen meditation 3 times, for 12/12/5 minutes, constantly bringing ourselves back to a state of emptiness.
座禅を3回それぞれ12分、12分、5分の長さでやって、頻繁に心を無の状態にもどしました。


Also, we took many breaks to keep ourselves fresh!
それと、たくさんの休憩ですっきりした状態をたもちました。

We worked on making an AI government using TDD in HTML and JavaScript. It's still incomplete, but here it is!
TDDでHTMLとJavaScriptでAIの政府を作ってみたけど、未完成です!
https://code4eiheiji.github.io/20180930_aigov.html

2018/09/22

ZenIT with IchigoSoda for Beginners

---From Taisuke Fukuno's blog post---

Eiheiji Town's Evolution Ambassador Amil gave a Zen x Programming workshop, combining Silicon Valley Extreme Programming style and Zen. He did at Eiheiji Town's Four Seasons Forest Cultural Center's Sanshoukaku room.

永平寺町エボリューション大使あみるによる、Zen x Programming ワークショップ。
シリコンバレースタイルと禅との融合
永平寺町、四季の森会館、永平寺の傘松閣を復元した「旧傘松閣資料館」が会場!

Over 3 hours (2pm-5pm), we enjoyed a mix of programming and Zazen meditation.

14時〜17時まで、たっぷり3時間、座禅も交えたペアプログラミング、楽しんでくれました!


IT, AI, robots, seem far from humans, but actually humans made them.
The best match must be the Zen x Silicon Valley style which keeps our mind and body healthy.

IT、AI、ロボット、人から遠いようで実は人が中心。
心身を健康にする禅とシリコンバレーでのプログラミングスタイルはベストマッチ。


Using two monitors, two keyboards, and one IchigoJam with two people at the same time is Silicon Valley Pair Programming style. We did a neat trick by using one IchigoJam to relay the keyboard and video signals to the other one. (Workshop Slides PDF)

2台のモニター、2台のキーボードで1台のIchigoJamを二人で同時に使うのが、シリコンバレーのペアプログラミングスタイル。 1台のIchigoJamを中継用にちょっと細工します。(ワークショップ、スライド PDF


The ESC key does not work on IchigoJam A because the program to transfer the keystrokes would be terminated (at which point you would have to press F5 to run it again).
IchigoJam A's left and right keys toggle the character's movement with two presses, which is a bit strange, so the game should be played with IchigoJam B.
We can fix it by changing the program to use INKEY instead of BTN.
36 K=INKEY():X=X-(K=28)+(K=29)

ESCキーは、IchigoJam Aでは効きません(キー転送用のプログラムが終わってしまうので、再度F5で動かそう)
IchigoJam A の左右キーは2度押して戻るトグル式となってちょっと操作感が違うので、ゲームするなら B で! 下記のようにBTNをINKEYに変えることで、同じ操作感になります。
36 K=INKEY():X=X-(K=28)+(K=29)


Having fun doing pair programming to make a game for the first time!

ペアで楽しむ、ゲームづくりではじめるプログラミング!



You can also make VR to change what you see with programming! We used Oculus Go and Smartphone MR during the break time.

VRや、視界だってプログラミングできちゃうよ!と休み時間中に Oculus Go や、スマホMRの体験会。


The huge Japanese style room had fantastic pictures on the ceiling!

160畳の広大な和室、見事な天井絵!


Perfect in Autumn... The Four Seasons Forest Culture Center.

秋晴れが気持ちいい、四季の森会館でした。

2018/09/06

IchigoJam + Docker/Linux/C Zen/Yoga Programming Workshop

今日はいろいろやってて楽しかったです!
We had fun doing many things today!

最初の方は20代男のしものさんとしゅんさんが四季の森文化館に来て、2階の禅部屋でIchigoJamをモニターにつながって簡単なペアプログラミングをやりました。
At first, Shimono, Shun, and myself, guys in our 20s, went up to the 2nd floor Zen room and did pair programming with IchigoJam connected to a monitor.

少し休憩を取って、ヨガも一緒に10分間ぐらいやって、みんな気持ちよかったと!
We took a break and did about 10 minutes of yoga and everyone said it felt really good!

その後はIchigoJamプロの道場さんが表して、シンプルなゲームの作り方を教えました。
After that, Dojo-san, an IchigoJam pro showed up, and helped us make a simple game.

次の休憩で4人で10分間ぐらい坐禅やってて、僕が頭がすっきりできたけど、10分間きついの一人もいました!
For the next break, all 4 of us did Zazen meditation for 10 minutes. I was able to calm down my mind, but one of us had trouble sitting still for that long!

その後は初心者ペアと経験者ペアに分けて、別々でプロジェクトを進みました。
After that we split into two pairs, beginners and advanced, to do our separate projects.

できたら、初心者ペアの方でIchigoJamのゲームを作って発表してもらいました。
A bit later, the beginners then presented their IchigoJam game that they made.


経験者ペアでWindows上のDockerのCentOS環境で簡単なCプログラムをviとgccで作って実行しました。
For the advanced pair, we used Docker on Windows to spin up a CentOS container to make a C program using vi and gcc.




最後は30分ぐらいかけて意見交換しました。シリコンバレースタイルのPivotal LabsのRetrospectiveというなやり方で!ペアとヨガが好きだった人が多くて、同時にさるに攻撃させるのは怖い人も多くて!
At the end, we spent about half an hour exchanging our opinions using the "retrospective" style from Pivotal Labs! Many people liked pair programming and Yoga, and just as many where scared of being attacked by monkeys!

2018/09/03

Zen Programming Workshop - Open Source Greenplum Database

今日は7年間もプログラミングやってる道場仁志(どうじょう・まさし)と2時間ぐらいの禅プログラミングワークショップやりました!福井駅辺りで合流して、風水のいい和食屋さんで晩ごはんを食べて元気になって、車で永平寺町の四季の森文化館に移動して、ワークショップを始まりました。
Today, I did a Zen programming workshop for about 2 hours with Masashi Dojo, a Japanese programmer with 7 years of experience! We met up at Fukui station, got pumped up after having dinner at a Japanese restaurant with nice Feng Shui, drove over to the Eiheiji Four Seasons Cultural Center, and started the workshop.

最初はWiFiのある1階のオフィスルームでGreenplumというなオープンソースのデータベースのコードをダウンロードして、Dockerでの環境をセットアップしました。ダウンロードする部が終わったら2階の傘松閣に上がりました。
At first, we used the WiFi in the first floor office room to download the open source Greenplum code and set up our Docker environment. After that, we went up to the 2nd floor Zen hall.
https://github.com/greenplum-db/gpdb/blob/master/README.docker.md


暑くて外で坐禅をしおとして、ベンチの上に座布団を敷いて大自然で10分間ぐらい坐禅して、あみるが結構心が落ち着きましたけど、気配で道場が緊張してしまいました。
It was pretty hot, so we went outside to do Zazen meditation on benches/zabuton for about 10 minutes in the beautiful nature under a starry sky surrounding by greenery. Amil got quite calm afterwards, but Masahi got nervours from being on alert of surroundings.


その後はワークショップを続いて、GreenplumのコードのConfigureとBuildとInstallをして、Demo Clusterを立ち上げられました。
After that, we configured, built, and installed the code after which we set up a demo cluster.




Greenplumの構成も少し説明して、簡単なSQL Queryを書きました。
I also explained the Greenplum architecture and we wrote some simple SQL queries.

GitHubにオープンソースのPRも作れました!
Finally, we put up an open source PR on GitHub!
https://github.com/greenplum-db/gpdb/pull/5661



最後にまた外で坐禅しに行きましたけど、動物が近くに感じて怖くて中に入って鍵をかけました!
At the end we went outside to do Zazen meditation again, but got scared from the noises of animals we felt around us, so ran inside and locked the doors!

道場さんの感想は外は怖くて、LinuxとviとGitHubの使い方をもう少し学べて良かったです。勉強できてありがたいです。
Masahi's impressions were first scared! and then thankful that he could study Linux, vi, and GitHub!

2018/09/01

Zen Programming - Private Class

今日は鍋山真一郎君と禅プログラミング授業をやりました。彼は15歳だけど、ある程度英語ができて、前も開発の経験があって、かなり複雑な開発できました。
Today, I gave a Zen programming private lesson to Shinichiro Nabeyama, a 15-year-old Japanese high school student who knows a little bit of English and had some prior experience with programming.

方語の英語と日本語で喋って、Windows上にDockerを使って、CentOSのContainerを立ち上げて、gccで僕たちがviで書いたCコードをCompileして実行しました。
While communicating with simple English and Japanese, we used Docker on Windows to spin up CentOS containers, upon which we used vi to write C code that we compiled and ran with gcc.


しん君はCの言語にそんな経験がなかったから、多くの時間はC言語の構文を説明するために使っちゃったから、コード自体はそんな複雑ではなかったけど、少しTDDができました。
Shinichiro didn’t have much experience with C, so a lot of our time was spent on explaining the fundamentals of C, but the actual code was not so complicated and we could do some TDD.

#include "assert.h"
#include "stdio.h"
#include "string.h"

char* artist(char* song)
{
        if (0 == strcmp(song, "levels"))
                return "avicii";
        else if (0 == strcmp(song, "faded"))
                return "alan walker";
        else if (0 == strcmp(song,"lose"))
                return "shinzex";

        return "unknown";
}

int addBack_old(int x)
{
        if (x == 0)
                return 0;
        if (x == 1)
                return 1;
        if (x == 2)
                return 1 + 2;
        if (x == 3)
                return 1 + 2 + 3;
        if (x == 4)
                return 1 + 2 + 3 + 4;

        return -1;
}

//recursive
int addBack(int x)
{
        if (x == 0)
                return 0;

        return x + addBack(x-1);
}

void test()
{
        assert(addBack(0) == 0);
        assert(addBack(1) == 1);
        assert(addBack(2) == 3);
        assert(addBack(3) == 6);
        assert(addBack(4) == 10);
        printf("pass\n");
}

int main()
{
        //printf(artist("levels")); printf("\n");
        //printf(artist("faded")); printf("\n");
        //printf(artist("lose")); printf("\n");

        test();

        //for (int i = 0; i <= 4; i++)
        //{
        //      printf("%d", addBack(i));
        //      printf("\n");
        //}
}

Recursive functionの作り方も教えました。
I also taught a bit about recursive functions.


もちろん、禅プログラミングのワークショップだったから、坐禅もやりました。自分が13年前からやってるヨガも少し一緒にできました。
Of course, being a Zen programming workshop, we did Zazen. Also, I showed Shinichiro some of the Yoga I had been practicing for 13 years.

Extreme Programmingというなシリコンバレースタイルのペアプログラミングもやってて、2つのモニター、2つのキーボード、2つのマウスでした。あいにく、しん君のキーボードは日本語版だったからかなり苦労しました。
Using the “Silicon Valley style” Extreme programming, we used 2 monitors, 2 keyboards, 2 mice. Unfortunately, Shinichiro’s keyboard was Japanese so we had some difficulties there!



傘松閣の電気の付け方にも間違ってかなり時間使っちゃいました。扇風機もなくて、暑くてしん君が苦労してました。
We also had some trouble turning on the lights in the Zazen room, as well as no fan, so Shinichiro was bearing the heat!

短い3時間でしたが、いろんなことができて、成功のもとである失敗もできて、いい体験でした!
It was a short 3 hours, but we were able to do many things, and make some mistakes to help make next time even better!