Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ruby Quiz
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
pocke
October 08, 2017
Programming
660
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby Quiz
at 学生エンジニア限定LT大会
pocke
October 08, 2017
More Decks by pocke
See All by pocke
New "Type" system on PicoRuby
pocke
2
2k
プログラミングで遊ぶ
pocke
0
170
Witchcraft for Memory
pocke
1
6.9k
The path to memory reduction in RBS
pocke
0
110
RBSのメモリ使用量改善への道
pocke
1
94
Community-driven RBS repository
pocke
2
1.8k
Active Record Query Quiz
pocke
1
1.7k
Let's write RBS!
pocke
1
5.5k
RBS and Rails, Present and Future
pocke
1
1.5k
Other Decks in Programming
See All in Programming
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
120
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1.3k
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
230
Railsバージョンを4倍にした話
optim
0
690
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
240
最近”作らせてる” ローカルAIアプリの話
akit37
0
500
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
190
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
960
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
150
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
9
6.5k
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4.5k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
A better future with KSS
kneath
240
18k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
550
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The Invisible Side of Design
smashingmag
301
52k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Google's AI Overviews - The New Search
badams
0
1.6k
sira's awesome portfolio website redesign presentation
elsirapls
0
470
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
610
Transcript
Ruby Quiz Oct. 8, 2017 第4回 学生エンジニア限定LT大会
I have only 5 minutes, so I'll speak very fast.
Self introduction • Pocke • Actcat, Inc. / SideCI •
RuboCop' s core developer • Student at The Open University of Japan
SideCI
Automated Code Review as a Service
Please access here! https://sideci.com
Ruby Quiz
Question
Do you write Ruby?
Ruby Quiz • You are a Ruby interpreter. ◦ You
are a parse.y. ◦ You are a YARV. • You execute ruby code, and you output result.
Quiz 1
Q. What does the code output? p(??) p(%_?_)
Answer p(??) # => "?" p(%_?_) # => "?"
Why?
A. Why does it output "?"? p(??) p(%_?_) %<any character>…<any
character> is a string literal. e.g.) %_?_ == "?" , %!???! == "???" ?_ is a character literal. e.g.) ?_ == "_" , ?? == "?"
Quiz 2
Q. What does the code output? p(????::?:) p(% %s% %%%%)
Answer p(????::?:) # => ":" p(% %s% %%%%) # =>
"%"
Why????
Answer p(????::?:) p(% %s% %%%%) 1. ?? is "?" 2.
? is a part of conditional op 3. ?: is ":" 4. : is a part of conditional op 5. ?: is ":" "?" ? ":" : ":" 1. % %s% is "%s%" 2. % is a format op(Like sprintf) 3. %%% is "" sprintf("%s%", "")
Quiz 3
Q. What does the code output? a = ["1","2","3"] a&.map(&:to_i)&.&([1])
Answer a = ["1","2","3"] a&.map(&:to_i)&.&([1]) # => [1]
Why?????
Answer a = ["1","2","3"] a&.map(&:to_i)&.&([1]) # => [1] &. is
a safe navigation op(nil guard). &:to_i is an implicit to_proc op. A safe navigation op & is an intersection op call (like [1,2,3] & [1])
Conclusion
• We can write tricky code in Ruby. ◦ Very
fun!!! Thank you for listening! Conclusion