Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Learn ruby with doukaku
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Fumiaki MATSUSHIMA
April 28, 2016
Programming
2.1k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Learn ruby with doukaku
西日暮里.rb ゴールデンだよLT大会 @ 秋葉原UDX!!
Fumiaki MATSUSHIMA
April 28, 2016
More Decks by Fumiaki MATSUSHIMA
See All by Fumiaki MATSUSHIMA
Learning from performance improvements on GraphQL Ruby
mtsmfm
1
1.3k
Ruby で作る Ruby (物理)
mtsmfm
1
280
GraphQL Ruby benchmark
mtsmfm
1
910
タイムアウトにご用心 / Timeout might break application state
mtsmfm
6
2.7k
Build REST API with GraphQL Ruby
mtsmfm
0
390
GraphQL Ruby をちょっとだけ速くした / Make graphql-ruby faster a bit
mtsmfm
1
780
Gaming PC on GCP
mtsmfm
0
810
How to introduce GraphQL to an existing React-Redux application
mtsmfm
1
310
Canary release in StudySapuri
mtsmfm
0
3.3k
Other Decks in Programming
See All in Programming
act1-costs.pdf
sumedhbala
0
120
JavaDoc 再入門
nagise
1
420
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
860
どこまでゆるくて許されるのか
tk3fftk
0
260
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
150
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
970
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
230
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.6k
Featured
See All Featured
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Agile that works and the tools we love
rasmusluckow
331
22k
Prompt Engineering for Job Search
mfonobong
0
350
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Designing for Timeless Needs
cassininazir
1
260
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
220
BBQ
matthewcrist
89
10k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
440
Transcript
(株)永和システムマネジメント @mtsmfm 松島 史秋 どう書くで学ぶ Ruby
松島 史秋 GitHub, Twitter, Nintendo ID @mtsmfm
None
どう書く
https://yhpg.doorkeeper.jp/
http://nabetani.sakura.ne.jp/hena/orde03nofconv/
多角形の頂点のうち、 内角が180度より小さいも のの数を計算する プログラムを書け。
スタート!!!
...
1時間後
Emoji provided free by Emoji One
Emoji provided free by Emoji One
できても できなくても 発表
Emoji provided free by Emoji One
おもしろい!
None
1時間という枠
素振り重要 Photo by cambodia4kidsorg
文字列操作
どう書くの 入力は 文字列
/*0*/ test( "1a2t3s2s", "11" ); /*1*/ test( "1a1c1d00", "22" );
/*2*/ test( "00", "20" ); /*3*/ test( "3q", "6" ); /*4*/ test( "3t2a", "8" ); /*5*/ test( "3t3a", "8" ); /*6*/ test( "3t4a", "12" ); /*7*/ test( "004q2g", "32" ); /*8*/ test( "4c2g2k4i", "24" ); /*9*/ test( "1o1a4f4i1t", "26" ); /*10*/ test( "4t3a4g2a2o2p", "24" ); /*11*/ test( "4i4o3i3c3n3h2c", "30" ); /*12*/ test( "4m3n3m002b1b3a", "34" ); /*13*/ test( "001b2a3t4s3s2s1s", "27" ); /*14*/ test( "1n1j3o4o1h2n2r1k", "36" ); /*15*/ test( "4o2a2j1m2e4l2l3m3o", "42" );
String#scan '1a2t3s2s'.scan(/\d\w/) #=> ["1a", "2t", "3s", "2s"]
String#chars
String#ord Integer#chr ?a.ord #=> 97 97.chr #=> "a"
配列操作
Array#zip Array#rotate
Array#combination a = [1, 2, 3, 4] a.combination(1).to_a => [[1],[2],[3],[4]]
a.combination(2).to_a => [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] a.combination(3).to_a => [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] a.combination(4).to_a => [[1,2,3,4]]
Array#transpose [ [1,2], [3,4], [5,6] ].transpose => [[1, 3, 5],
[2, 4, 6]]
Enumerable#each_slice Enumerable#each_cons
&.
Ruby 組込みだけで 超便利!
便利 gem
gem 'activesupport', require: 'active_support/all'
あれ? AS だっけ? 標準だっけ?
Emoji provided free by Emoji One
gem 'pry-rescue'
例外上がった ところで 止まる
Bundler
require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'activesupport', require: 'active_support/all'
end
結果の共有に 便利
フィードバック
'1a2t3s2s'.scan(/\d\w/) #=> ["1a", "2t", "3s", "2s"]
'1a2t3s2s'.scan(/../) #=> ["1a", "2t", "3s", "2s"]
'1a2t3s2s'.scan(/../) #=> ["1a", "2t", "3s", "2s"] Emoji provided free by
Emoji One
別言語で解く
Ruby の表現力
“Rubyをキメると 気持ちいい” - matz