icon

Ruby でやってみる『機械学習 はじめよう第3回 ベイジアンフィルタを実装してみよう』メモ - 牌語備忘録 -pygo http://cortyuming.hateblo.jp/entry/20140627/p2

Web site image
Ruby でやってみる『機械学習 はじめよう第3回 ベイジアンフィルタを実装してみよう』メモ
2017-05-07 07:48:12 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-07 08:29:46 zundaの投稿 zundan@mastodon.zunda.ninja
icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 43.3 MB
Tables: 26
Rows: 46869/10000000 (In compliance)

icon

Starting to use Logentries.

2017-05-07 15:15:51 zundaの投稿 zundan@mastodon.zunda.ninja
icon

そうだ、コード、書こう!

icon

$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ cd ~/.rbenv && src/configure && make -C src
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$ tail -2 .bashrc
export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
$ rbenv install 2.4.1

そこから

Web site image
GitHub - rbenv/rbenv: Manage your app''s Ruby environment
Web site image
GitHub - rbenv/ruby-build: A tool to download, compile, and install Ruby on Unix-like systems.
icon
Web site image
GitHub - rbenv/rbenv: Manage your app''s Ruby environment
Web site image
GitHub - rbenv/ruby-build: A tool to download, compile, and install Ruby on Unix-like systems.
icon

Rubyのコンパイルで電池がやばい (久しぶりの環境で本筋にたどりつく前に時間切れになるパターン)

icon

BUILD FAILED (Ubuntu 17.04 using ruby-build 20170405-4-g365dd1f)

ERROR: Ruby install aborted due to missing extensions
Try running `apt-get install -y libreadline-dev` to fetch missing dependencies.

あー

2017-05-07 17:39:07 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-07 17:39:08 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Redisのコネクションプールの使い方を知らないといけないことに気づいたところでそろそろ時間切れ (Rubyはまだコンパイル中w)

https://github.com/zunda/factorize

Web site image
GitHub - zunda/factorize: A scalable library to factorize sets of integers
icon

Map Redis types directly to Ruby objects

https://github.com/nateware/redis-objects

Web site image
GitHub - nateware/redis-objects: Map Redis types directly to Ruby objects
icon

にゃーん

icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 44.1 MB
Tables: 26
Rows: 48877/10000000 (In compliance)

icon

「直ちに」の定義

icon

スレッドとかホストとかの間のやり取りにRedisじゃなくてGoのチャンネル使ったらどうかと思ったけど、チャンネルはネットワーク超えられないよなw

2017-05-08 07:23:22 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-08 07:23:28 zundaの投稿 zundan@mastodon.zunda.ninja
icon

@h12o@blessedgeeks.org そしてプルリクエスト!!

2017-05-08 09:23:34 zundaの投稿 zundan@mastodon.zunda.ninja
icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 7/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 44.8 MB
Tables: 26
Rows: 49227/10000000 (In compliance)

2017-05-08 14:20:57 zundaの投稿 zundan@mastodon.zunda.ninja
icon

require 'fakeredis'しなくてもRedis使えるのなんで?と思ったらローカルでRedisが動いていたという

2017-05-08 15:04:18 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-08 15:14:58 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-08 16:32:49 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-08 16:57:54 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-08 20:18:44 zundaの投稿 zundan@mastodon.zunda.ninja
icon

コード書くよー(目をしょぼしょぼさせながら)

icon

Redisつこてると並列にはテスト流せないのな

icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 10/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 45.5 MB
Tables: 26
Rows: 50520/10000000 (In compliance)

2017-05-09 07:08:03 zundaの投稿 zundan@mastodon.zunda.ninja
icon

Nice day to wash bed covers.

icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 45.9 MB
Tables: 26
Rows: 50541/10000000 (In compliance)

icon

Vegemite!

icon

スペルミスしたのどこまで消えるかな?

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
icon

cld3-3.1.0 does not seem to be built on Heroku:

$ heroku apps:fork --from zundan-mastodon-staging --to zundan-mastodon-master
$ heroku pipelines:add zundan-mastodon -a zundan-mastodon-master --stage development

Enable Automatic Deploys from master

$ git fetch upstream
$ git checkout master
$ git rebase upstream/master
$ git push origin

$ ruby -r ./siteconf20170509-1178-131c6bz.rb extconf.rb
sh: 1: protoc: not found

icon

"you need to install protoc as well to have Ruby code generation functionality" https://github.com/google/protobuf/tree/master/ruby

well...

icon

Mastodon master with cld3 works on Heroku with heroku-buildpack-apt but I feel this a little bit cranky: https://github.com/zunda/mastodon/compare/master...use-cld3-on-heroku

Web site image
Comparing master...use-cld3-on-heroku · zunda/mastodon
icon

@ykzts できるけどやりたくない感じでつよね…

icon

I've just paid the cost for this instance on Heroku for April, whic is $8.32.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
icon

スタンディングデスクが物置になってたのを整理した

icon

$ heroku pg:info DATAB
ASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 46.4 MB
Tables: 26
Rows: 52405/10000000 (In compliance)

icon

UTCにしてるブラウザでSlack読んでて、どうしてみんな変な時間に起きてるのかな?って

icon

The spike in traffic was mostly HEAD request to /users/zundan/updates/533 as well as GET to /users/zundan/updates/533.atom from different IP addresses. I suppose the conversation was picked up somewhere and, well, maybe clients rendered the conversation on the fly on their browser?

icon

自動的にfavouriteするアカウントはブロックすればいいんだっけ

icon

The first peak in memory use was when I posted a photograph. Mastodon ran some commands on the dyno to process the image which, I suppose, was then posted to S3.

icon

The second spike in memory use was when ImageMagick was ran against an avatar who appeared in Federated timeline. Interesting.

icon

@h12o@blessedgeeks.org 少なくともフォロー関係はそのまま別ドメインに持って行くとわけのわからないことになりそうですよねw

icon

←ぼっちインスタンスでのけもの

icon

@usa どったんばったん大騒ぎ(スワップメモリ的な意味で)

2017-05-10 23:42:22 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-10 23:42:24 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-10 23:42:25 zundaの投稿 zundan@mastodon.zunda.ninja
icon

ほうほう

2017-05-11 07:10:24 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-11 07:11:56 zundaの投稿 zundan@mastodon.zunda.ninja
icon

$ heroku remote -v
▸ remote is not a heroku command.

すみませんgitでしたw

Deploying Mastodon master on Heroku with build cache fails on node-sass
icon

$ heroku repo:purge_cache
$ git checkout -b use-cld3-on-heroku-no-rebuild 2b99b4
$ git push -f heroku-mastodon-master use-cld3-on-heroku-no-rebuild:master
$ git commit --allow-empty -m 'deploying with build cache'
$ git push -f heroku-mastodon-master use-cld3-on-heroku-no-rebuild:master
:
remote: Module build failed: Error: ENOENT: no such file or directory, scandir '…/node_modules/node-sass/vendor'
:

icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 47.8 MB
Tables: 26
Rows: 54918/10000000 (In compliance)

icon

I thought I did this already but finally moved stack for this instance from Cedar-14 to Heroku-16 resulted in reduction of slug size from 244 MB to 235 MB :)

icon

masterとzunad-ninja-on-herokuをまぜまぜ (どきどき)

icon

masterに移ったらデータベースのマイグレーション走ったやん!

icon

うまくできたようだ(マストドンのにくではない)

icon

@hyuki ローカルタイムラインには自分しかいませんがリプライとかブーストは含まれない感じです。連合と比べてホームには自分へのリプライが多くて、ホームに比べて連合には時々知らない方のトゥートが混ざります。ご参考まで :-)

icon

@hyuki 連合には自分からのリプライも表示されませんねー

icon

\テスト\/ですと/

icon

プルリクエスト出して安心してたけどまだ洗濯物たたんでなかったw

And at least some statuses are detected as Japanese :)
icon

> SELECT text, language FROM statuses WHERE account_id=1 ORDER BY id DESC LIMIT 3;

text | プルリクエスト出して安心してたけどまだ洗濯物たたんでなかったw
language | ja

text | \テスト\/ですと/
language | ja

text | @hyuki 連合には自分からのリプライも表示されませんねー
language | sn

2017-05-11 23:14:50 zundaの投稿 zundan@mastodon.zunda.ninja
Oops, what did I miss?
icon

May 12 15:57:02 zundan-mastodon heroku/router: at=error code=H19 desc="Backend connection timeout" method=POST path="/api/subscriptions/1418" host=mastodon.zunda.ninja request_id=526c7d63-68a7-4685-a595-9a8f529a9e29 fwd="217.182.80.236" dyno=web.1 connect=5000ms service= status=503 bytes= protocol=https

2017-05-12 07:50:51 zundaの投稿 zundan@mastodon.zunda.ninja
icon

ペプシを冷やさないで飲む (おいしい)

icon

Webpacker is installed 🎉 🍰

ケーキたべたいなあ

icon

\masterに/ \追随/ \しますたー/

66328adf83793844a94b32ec9d4b44523b65a6f0

icon

Streaming APIからの更新がブラウザに届いてないかもしれない

icon

てかStreaming APIにアクセスしてないやんw

icon

heroku config:unset STREAMING_API_BASE_URLするとmethod=GET path=/api/v1/streaming status=404ですねー

icon

STREAMING_API_BASE_URLの最初をhttps://からws://にしても来ない

icon

wss:// にしたらおっけー!!

icon

無意識のうちにアイスクリームを全部食べてしまった。悲しい。

icon

LastPassの動作がおかしいと思ったらテザリング先のIPアドレスを怪しいと思っていたらしい

icon

低いちゃぶ台でお仕事中。Sitting desk。

2017-05-13 03:59:16 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-13 03:59:50 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-13 04:04:02 zundaの投稿 zundan@mastodon.zunda.ninja
2017-05-13 08:07:13 zundaの投稿 zundan@mastodon.zunda.ninja
icon

$ heroku pg:info DATABASE
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 8/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 51.6 MB
Tables: 27
Rows: 58940/10000000 (In compliance)

icon

温泉インスタンス…!?

Cherry-pick職人の朝は早い。
icon

彼がシェルを起動するのは夜が白み始める前、コードを書いていた最後のプログラマが眠りについてエディタが空白文字で満たされる頃だ。「この時間帯に一番生きのいいcommitが取れるんですよ。お互いケンカも少ない」職人はほほえみつつ、見事なマウスさばきでlogからハッシュをコピーペーストしてcherry-pickを繰り返す。「rebase -i?ありゃあダメだね。エディタの匂いがついちまう:wq」職人のNo Newline at End of Fileを見つめる目はやさしい。

Cherry-pick職人は、丹精を込めてbranchに並べたcommitたちをrequest-pullしていちにちを終える。「Pull Requestの方が早いんじゃないかって?あれもダメだ。不自由なソフトウェアが絡んでるし、足が4本しかない」と愚痴をこぼす。職人ならではのこだわりが感じられる瞬間だ。

icon

500文字って長いよな。原稿用紙1枚超えるもんな。

icon

空いたメモリにんぐんくす入れてみようかな

icon

どのビルドパック使うのが良いかまよったのでまあいいや

2017-05-13 12:02:23 zundaの投稿 zundan@mastodon.zunda.ninja
icon

9.6.1も対象だ…

2017-05-13 08:47:05 zundaの投稿 zundan@mastodon.zunda.ninja
Cherry-pick職人の朝は早い。
icon

彼がシェルを起動するのは夜が白み始める前、コードを書いていた最後のプログラマが眠りについてエディタが空白文字で満たされる頃だ。「この時間帯に一番生きのいいcommitが取れるんですよ。お互いケンカも少ない」職人はほほえみつつ、見事なマウスさばきでlogからハッシュをコピーペーストしてcherry-pickを繰り返す。「rebase -i?ありゃあダメだね。エディタの匂いがついちまう:wq」職人のNo Newline at End of Fileを見つめる目はやさしい。

Cherry-pick職人は、丹精を込めてbranchに並べたcommitたちをrequest-pullしていちにちを終える。「Pull Requestの方が早いんじゃないかって?あれもダメだ。不自由なソフトウェアが絡んでるし、足が4本しかない」と愚痴をこぼす。職人ならではのこだわりが感じられる瞬間だ。

icon

がんばって作文したのにw