owned this note
owned this note
Published
Linked with GitHub
# Hamamatsu.rb #140
## 自己紹介
## 前回ふりかえり
- http://firekpt.jacoyutorius.com/board/?id=-NBvoWmoE54vn6lS3ZBp&title=Hamamatsu.rb%20%23139
## 今回のネタ
### パターンマッチング
- このCSVのパーサーなんかはパターンマッチ使って書ける?/...
- [適格請求書発行事業者の情報](https://www.invoice-kohyo.nta.go.jp/download/zenken#csv-filtyp)
- jsonじゃないと列名入ってない
- jsonを読み込んで中身を検索するときにパターンマッチ使えるかも
```ruby=
require 'json'
JSON.parse(File.read(ARGV.shift), symbolize_names: true).each do |org|
case org
in { name: /協会$/ => name,
latest: "1" => latest
}
puts name + "[" + latest + "]"
else
# do nothing
end
end
```
### マルチプラットフォーム(Windows、macOS、iOS、Android、複数解像度)でGUIを作るなら?
- Flutter vs .NET Core vs Qt vs Kotlin vs Unity
- Flutter + 2
- React Native
- Electron
- https://www.electronjs.org/ja/docs/latest
- Githubでもソースいっぱい使われてるので普及率高いかも
- Qtが存在感無いけどいろんな言語に対応してるよ
- 商用版とオープンソース版同時リリースの走り
- 炎上気味??お金払ってる人にしか高機能リリースしないよ問題
- KDE Free Qt Foundationについて
- https://qiita.com/hermit4/items/d3f88d1edacdebe07c8e
- Webブラウザベース
- Titanium...死んでないよ
### RubyKaigi
- 実は、はじめは「RubyKaigi」という名前ではなかった ─ 創始者と貢献者たちが、歴史を赤裸々…
- https://engineer-lab.findy-code.io/history-of-rubykaigi
- 興味あれば読んでおいて~
- Yuta Saitoさん「RubyはWebAssemblyと出会った」 〜RubyKaigi 20…
- https://gihyo.jp/article/2022/10/rubykaigi2022-1
- WebAssemblyならRubyインストールしなくても動く
### 最近のRubyでクローラー書くなら `mechanize` らしい?
- https://github.com/sparklemotion/mechanize
- こういうとことかクロールしたいね
- 浜松市イベントカレンダー
- https://www.city.hamamatsu.shizuoka.jp/cgi-bin/event_cal/cal_month.cgi
```ruby=
def links(page)
links = page.search('#tmp_contents > #tmp_event_list > li > a').map do |link|
URI.join('https://www.city.hamamatsu.shizuoka.jp', link.attributes['href'].value)
end
@links.concat(links)
next_link = page.links_with(text: '次へ')
if next_link.length == 0
return @links
end
next_page = next_link.first.click
links(next_page)
end
```
### 気になるニュース
- [トヨタ、個人情報29万件以上漏えいか 委託先企業がGitHubにソースコード公開](https://www.itmedia.co.jp/business/articles/2210/07/news174.html)
- ある程度Githubで警告はしてくれるらしい
- 警告に頼らないように
- push先間違えないように気を付けよう
- [トヨタ自動車傘下のウーブン・アルファ、GitHubを活用したソフトウェア開発事例を紹介](https://cloud.watch.impress.co.jp/docs/news/1304444.html)
- ※漏洩したのはこの企業の方ではない
- エキサイト翻訳終了のお知らせ : エキサイト翻訳・オフィシャルブログ
- https://blog.excite.co.jp/exhonyaku/32770675/
- 文法的な間違いは少なかったらしい
- ウクライナ発個人プロジェクトGitLabが1兆円規模のIPOへ、その4つの教訓 | Coral Capital
- https://coralcap.co/2021/10/gitlab-ipo/
## LT
- Github Actions を使った複数の言語バージョン・フレームワークバージョンでのテスト/Lint(@jacoyutorius)
- https://github.com/jacoyutorius/matrix_job_sample
- gemがバージョンアップしたりするといろいろ動かなくなる
- 問題が小さいうちに検知したい
- Github Actionsでテストしたい
- matrix...2x2で4環境作成され、それぞれの環境でジョブ実行される
- あらかじめgemfileを用意する必要がある
- 実践投入はこれから
- いまのところ特定のバージョンで失敗するらしい
- GAはテンプレもいっぱいあります
- GAは容量次第で無料
- まずテストコード書くとこから始めないと無理
- 神クラスはリファクタリングしていく
- CircleCIはローカルでも流せるらしい
- 有償範囲の話(About billing for GitHub Actions)
- https://docs.github.com/ja/billing/managing-billing-for-github-actions/about-billing-for-github-actions
### Github Actionsのベストプラクティスとかある?
- 実運用はCircleCIでやってます
- 分散稼働できるようにして最適化したり
- UIの部分はテストが難しい…ので最小限にする
- 一番下の各関数のテストを多くした方が良い。テストも書きやすい
- 逆に言うとこのテスト書きづらいのであれば神クラスいっぱいあるということになる
- UIもうまく作ってうまくテストすれば昔よりはできるようになった。フロント-バックエンドがはっきり分かるようになった
- [Renovate](https://github.com/renovatebot/renovate)を使った依存パッケージアップデート(@suchi)
- マルチプラットフォームかつマルチ言語の依存ライブラリのアップデート機能
- プルリクをどんどん勝手に作ってくれる
- コマンドラインやGithub Applicationから実行
- ライブラリの1つのバージョンアップで1つのPR作成する
- PRのまとめや自動マージを行ってくれる
- Github Actionのタスクバージョンも対象
- Githubで設定した途端にすぐプルリクが来る勢い
- Railsのほぼ初期状態でもプルリクが上がってくる
- 上げなきゃいけないのがいっぱい出てくる
- Dependabotから乗り換える話が出てる
- 毎日とか週一の運用をしていた
- Electron使ってる場合は半年に一回やらないとメジャーバージョンアップに追いつけない
- Railsのバージョン上げるのは大変そう
- やはり自動テストありき
- レガシーコード改善会もあってもいいかも
- レガシーコード改善ガイド とか
- https://www.amazon.co.jp/%E3%83%AC%E3%82%AC%E3%82%B7%E3%83%BC%E3%82%B3%E3%83%BC%E3%83%89%E6%94%B9%E5%96%84%E3%82%AC%E3%82%A4%E3%83%89-Object-Oriented-SELECTION-%E3%83%9E%E3%82%A4%E3%82%B1%E3%83%AB%E3%83%BBC%E3%83%BB%E3%83%95%E3%82%A7%E3%82%B6%E3%83%BC%E3%82%BA/dp/4798116831
## 振り返り
- http://firekpt.jacoyutorius.com/board/?id=-NEB4vLiPKae4GN4GVe2&title=Hamamatsu.rb%20%23140
## 次回以降のネタ
- クローリングする
- https://github.com/sparklemotion/mechanize
- WebAssemblyを試す
- https://github.com/ruby/ruby.wasm
- 言語処理100本ノック をパターンマッチありのRubyで試す
- 4.元素記号
- 5.n-gram
- 6.集合
- 7.テンプレートによる文生成
- 8.暗号文
- 20.JSONデータの読み込み
- 21.カテゴリ名を含む行を抽出
- 22.カテゴリ名の抽出
- 23.セクション構造
- 24.ファイル参照の抽出
- 25.テンプレートの抽出
- 31.動詞
- 32.動詞の基本形
- 33.「AのB」
- 34.名詞の連接
- ぜんぜんわからん↓
- 40.係り受け解析結果の読み込み(形態素)
- 50.データの入手・整形
- 51.特徴量抽出
- 第8章: ニューラルネット
- 第9章: RNN, CNN
- 第10章: 機械翻訳
- 第7章: 単語ベクトル はファイルサイズが大きすぎるので無理(圧縮7GB)
## 告知
- 10/15(土) Fukuoka mrubykaigi 2022
- https://mrubyworkshop.connpass.com/event/261953/
- 10/21(金),22(土) Kaigi on Rails
- オンライン
- https://kaigionrails.org/2022/
- 11/5(土) Hamamatsu Micro Maker Faire 2022 @ 浜松科学館
- https://makezine.jp/event/makerfaire/hmmf2022/
- [Arduino Unoで動くシンセサイザを出します](https://av.watch.impress.co.jp/docs/series/dal/1439090.html)
- 11/5(土) 浜松市・次世代の数学スペシャリスト養成プロジェクト
- [Challenge to society 5.0 in HAMAMATSU 高校生特別講座](https://challenge-to-society-hamamatsu.com/special-course/)
- SOU(https://sou-hamamatsu.jp/)良かったです
- Dexi板屋の地下
- 浜松IT忘年会やってもいいかも
- 静岡県浜松市中区板屋町102-15 B1
- https://www.google.com/maps/place/%E3%80%92430-0928+%E9%9D%99%E5%B2%A1%E7%9C%8C%E6%B5%9C%E6%9D%BE%E5%B8%82%E4%B8%AD%E5%8C%BA%E6%9D%BF%E5%B1%8B%E7%94%BA%EF%BC%91%EF%BC%90%EF%BC%92/@34.7071609,137.7332355,19z/data=!4m5!3m4!1s0x601ade7a8e2bd0e3:0xc02aaeaac17328db!8m2!3d34.7073759!4d137.7333924
- プレオープン前だがAWS Satelitesで使いました
- IT合同忘年会
- 検討中
- やる方向で
## KPT
- http://firekpt.jacoyutorius.com/board/?id=-NEB4vLiPKae4GN4GVe2&title=Hamamatsu.rb%20%23140
## 当日のチャット
```
19:25
https://en.wikipedia.org/wiki/Visual_Studio_Code
Visual Studio Code - Wikipedia
19:27
https://qiita.com/hermit4/items/d3f88d1edacdebe07c8e
KDE Free Qt Foundationについて - Qiita
19:33
https://twitter.com/_ko1/status/1579644815033380865
[Yuta Saitoさん「RubyはWebAssemblyと出会った」 〜RubyKaigi 2022 1日目キーノート | http://gihyo.jp](https://gihyo.jp/article/2022/10/rubykaigi2022-1) 3日目もやるんだろうか...
19:35
https://try.ruby-lang.org/playground/
TryRuby playground
19:41
def links(page)
links = page.search('#tmp_contents > #tmp_event_list > li > a').map do |link|
URI.join('https://www.city.hamamatsu.shizuoka.jp', link.attributes['href'].value)
end
@links.concat(links)
next_link = page.links_with(text: '次へ')
if next_link.length == 0
return @links
end
next_page = next_link.first.click
links(next_page)
end
19:48
https://thom.hateblo.jp/entry/2021/02/27/145223
GitHubに誤って自宅WiFiパスワードをPushしてしまったので対処した件 - t-hom’s diary
20:21
https://www.electronjs.org/docs/latest/tutorial/electron-timelines#version-support-policy
20:23
https://coralcap.co/2021/10/gitlab-ipo/
ウクライナ発個人プロジェクトGitLabが1兆円規模のIPOへ、その4つの教訓 | Coral Capital
23,"T1700150010520",01,0,2,1,1,2023-10-01,2022-07-26,,,"",,,"",,,"","東京都個人タクシー協同組合 新東京支部","",,,"",""
20:32
https://docs.ruby-lang.org/ja/3.1/library/json.html
20:34
https://blog.serverworks.co.jp/ruby-hash-schema-pattern-match
【Ruby】Hashの構造チェックはパターンマッチを使うと簡単 - サーバーワークスエンジニアブログ
20:37
warning: One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!
20:37
https://tech.medpeer.co.jp/entry/2021/01/12/100000
Ruby3.0でのパターンマッチ機能の変更点 - メドピア開発者ブログ
20:41
require 'json'
JSON.parse(File.read(ARGV.shift), symbolize_names: true).each do |org|
case org
in { name: /協会$/ => name }
puts name
else
# do nothing
end
end
20:46
https://tech.medpeer.co.jp/entry/2019/05/13/090000
20:52
https://twitter.com/okuramasafumi
20:52
https://twitter.com/okuramasafumi
20:55
https://av.watch.impress.co.jp/docs/series/dal/1439090.html
【藤本健のDigital Audio Laboratory】「Arduino Uno」でシンセサイ…
20:57
https://qiita.com/UT_BackendEngineer/items/982fed772efb33ca7d08
postdev:フロントエンド開発テスト最前線
21:04
浜松市中区板屋町102-15 B1F
21:07
http://firekpt.jacoyutorius.com/board/?id=-NEB4vLiPKae4GN4GVe2&title=Hamamatsu.rb%20%23140
21:11
https://av.watch.impress.co.jp/docs/series/dal/1074613.html
【藤本健のDigital Audio Laboratory】「けものエフェクター」も登場。本格派~異色の音モノがMaker Faireに集結 - AV Watch
2017年
21:17
https://av.watch.impress.co.jp/docs/series/dal/1201856.html
【藤本健のDigital Audio Laboratory】本格&おもしろシンセ集結! 空き缶のMIDI楽器、クマ型リズムマシンがMaker Faireに-AV Watch
2019年
21:18
https://av.watch.impress.co.jp/docs/series/dal/1014289.html
【藤本健のDigital Audio Laboratory】扇風機やドローンで演奏? ラズパイシンセなど、Maker Faireで見つけた音モノ - AV Watch
2016年
「記事になると思います」と言われて期待していたら、実際には掲載されず…(そういうもの)
21:28
かつ、この年の共同出展者の「チーム、LogiClover」さんは記事になっていたのが悔しかったりして…
21:31
https://p5play.org/
21:32
(旧)p5.playをかじる本v4.f51206
https://zenn.dev/sdkfz181tiger/books/cdf1887f4be85b
21:36
puts 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん'.chars
21:36
"あいうえお".split('')
21:37
p [*?あ..?ん]
["あ", "ぃ", "い", "ぅ", "う", "ぇ", "え", "ぉ", "お", "か", "が", "き", "ぎ", "く", "ぐ", "け", "げ", "こ", "ご", "さ", "ざ", "し", "じ", "す", "ず", "せ", "ぜ", "そ", "ぞ", "た", "だ", "ち", "ぢ", "っ", "つ", "づ", "て", "で", "と", "ど", "な", "に", "ぬ", "ね", "の", "は", "ば", "ぱ", "ひ", "び", "ぴ", "ふ", "ぶ", "ぷ", "へ", "べ", "ぺ", "ほ", "ぼ", "ぽ", "ま", "み", "む", "め", "も", "ゃ", "や", "ゅ", "ゆ", "ょ", "よ", "ら", "り", "る", "れ", "ろ", "ゎ", "わ", "ゐ", "ゑ", "を", "ん"]
21:37
("あ"..."ん").to_a
21:40
https://zenn.dev/nameless_sn/articles/framework_and_library
↓私の見解
フレームワークもライブラリの一部。ライブラリのうち、アーキテクチャを実装しているものがフレームワーク、と思ってた。
「全体もしくは一部のアーキテクチャ」の方が正確か。
21:42
https://digrajapan.org/?page_id=277
21:43
https://ja.wikipedia.org/wiki/%E6%9D%BE%E5%8E%9F%E4%BB%81_(%E6%83%85%E5%A0%B1%E5%B7%A5%E5%AD%A6%E8%80%85)
21:45
IIAI AAI 2022-Winter – 13th International Congress on Advanced Applied Informatics
https://iaiai.org/conference/aai2022-winter/
21:46
高度応用情報学国際会議
21:46
The 21st IEEE/WIC/ACM 2022
https://www.wi-iat.com/wi-iat2022/index.html
引用「We regret to inform you that your submission
WI259 - Toward Visualizing Others' Preferences for Good Encounters in A Virtual Space Systems
has not been accepted for presentation at WI-IAT 2022. 」
21:51
おのだくんもHamamatsu Micro Maker Faire 2022出展するみたいです
https://twitter.com/osarusystem/status/1580176537331978240
21:53
> RJ-45タイプのシリアルポート切替器キット
↑マニアックなw
22:01
https://www.ruby.or.jp/ja/certification/examination/version3.html
22:02
https://www.ruby.or.jp/ja/certification/examination/version3.html
22:05
https://ja.wikipedia.org/wiki/CASL
22:05
https://jstqb.jp/
JSTQB認定テスト技術者資格
22:07
https://www.engineer.or.jp/c_categories/index02009.html
第一次試験|公益社団法人 日本技術士会
22:08
https://qiita.com/ar1/items/84a69bb700f2695d9a68?utm_source=pocket_mylist
22:09
https://mvp.microsoft.com/ja-jp/
Microsoft MVP Award
https://www.microsoft.com/ja-jp/partner/contents/mcp.aspx
マイクロソフト認定資格
22:10
https://learn.microsoft.com/ja-jp/certifications/
```