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
Doing Interesting Things With Your Rails Data
Search
Serena Wales
August 01, 2013
Programming
15
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Doing Interesting Things With Your Rails Data
Serena Wales
August 01, 2013
Other Decks in Programming
See All in Programming
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
golang-bob.pdf
iwatsukayura
0
130
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
The Rails Doctrine Decade
koic
2
590
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
190
Railsバージョンを4倍にした話
optim
0
360
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
R8 の設定見直しでアプリサイズ削減
andpad
0
220
AWSに止められる覚悟してますか?
morizo_1984
2
540
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
Done Done
chrislema
187
17k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
My Coaching Mixtape
mlcsv
0
360
The Art of Programming - Codeland 2020
erikaheidi
57
14k
WENDY [Excerpt]
tessaabrams
14
40k
Code Reviewing Like a Champion
maltzj
529
40k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
550
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
Transcript
Doing Interesting Things With Your Data SFRails August 1st, 2013
WHO AM I? • Serena Wales • @gangleton on Github
and Twitter • 2012 Code for America fellow • CTO of Textizen • Rails dev
We are surrounded by data
Logs And Exhaust Data
Other people’s data!
What can you do with the data you’re already collecting?
And how do you make it useful for the people
using your application?
Medium Data
Why use ?
3 Approaches
• Front End • Back End • Way Back End
Front End
Explore your data • Gauss • https://github.com/wayoutmind/gauss • All kinds
of fun statistical functions • Underscore.js Collection and Array Methods • http://documentcloud.github.io/underscore/ • Like Enumerable, but different
Explore your data • http://misoproject.com/dataset/ • Handles loading, parsing, sorting,
and querying • Great if your underlying data is changing regularly
And make it visually useful • Flot • http://www.flotcharts.org/
And make it visually useful • D3 • http://d3js.org/
Front end: Pros • Great visualization options • Use tools
developed for rich user experiences • Works with dynamic data • Can build in interaction and allow people to customize their views
But not always great • Too much processing or data
can lock your interface • If you’re not using most of the data, that can be a lot of extra traffic and memory
Back End
ActiveRecord does things! • ActiveRecord::Calculations • http://api.rubyonrails.org/classes/ActiveRecord/ Calculations.html • Average,
Maximum, Minimum, Sum
ActiveRecord does more things! • ActiveRecord::QueryMethods • http://api.rubyonrails.org/files/activerecord/lib/ active_record/relation/query_methods_rb.html •
Group, Having, Where
For more robust analysis... • descriptive_statistics • statistics2 • SciRuby
• Statsample • NMatrix
Make charts in Ruby • Rubyvis • https://github.com/clbustos/rubyvis
Make charts in Ruby • Googlecharts • https://github.com/mattetti/googlecharts require ‘googlecharts’
data = [1, 1.2, 1.7, 1.5, 0.7, 0.3] Gchart.bar(:data => data)
Make charts in Ruby • Gruff • https://github.com/topfunky/gruff require ‘gruff’
data = [1, 1.2, 1.7, 1.5, 0.7, 0.3] g = Gruff::Bar.new g.data :heights, data g.write(‘chart.png’)
Where do I put this stuff? • Not in your
view. • Probably not in your model • Use more classes
Load time > 3 minutes • Optimize for reading •
Cache results • Recalculate after changes
Back End: Pros • Object-oriented organization • Access whatever you
need • Take advantage of your data store
Back End: Cons • Graphing • Underdeveloped or underfeatured libraries
• Page rendering performance
Way Back End
For when your data is really, really complicated or you
have a lot of it
Doing complicated things with numbers? • Scientists seem to like
R • RSRuby • https://github.com/alexgutteridge/rsruby • Rook • http://cran.r-project.org/web/packages/Rook/ index.html
Have lots of numbers?
None
The Future!
Thanks for listening! @gangleton www.textizen.com