Practical Data Processing Using  Map, Reduce and Select with Ruby
Practical Data Processing Using Map, Reduce and Select with Ruby

EMBARGO!

Journalists and bloggers: please do not publish anything about this until the embargo is lifted!

Please contact the author for more information about when this is.

Practical Data Processing Using  Map, Reduce and Select with Ruby

This book is 90% complete

Last updated on 2017-12-26

About the Book

This program prints out Pascal's triangle. 

puts (0...10).reduce([[1]]) { |a,x|

    a.unshift a.first.reduce([0,[]]) { |b,y|

        [y,b.last << (b.first + y)]

    }.last + [1]

}.reduce([]) { |c,z|

    next [z[z.length/2].to_s.length*2,z.length,""] if c.empty?

    [c[0],c[1], z.map { |j|

            j.to_s.center(c[0])

        }.join('').center(c[0]*c[1])+"\n#{c.last}"]

}.last

I found it on the internet at kellegous.com. How does such a complex program get encoded in 10 lines of code? Use this book to learn how to use map, reduce, and select with Ruby to solve data processing problems. Use this book along with a computer wth Ruby installed, a text editor, and the irb (interactive Ruby) prompt. As you read, type in the code, run the code and ponder the results. Tweak the code to test the code and the results. This book will walk you through problems and solutions which are effective because they use map, reduce, and select. You will gain a deeper understanding on how to break data processing problems into processing stages, each of which is understandable, debuggable, and composable, and how to combine the stages to solve your data processing problem. 

About the Author

Jay Godse
Jay Godse

Jay Godse graduated with an engineering degree, and then went to work as a digital circuit designer. After a year of that he switched to software development and has been there ever since in some form. His early work was mostly real-time telecommunication device control and provisioning using languages such as C and Protel. He then transitioned into designing distributed computing systems, using languages such as C++ and CORBA IDL. After that, transitioned into web applications. Along the way he did stints as a software development manager and a software architect. But for the last 7 years, he has written web applications using Ruby on Rails, SQL, Javascript, et cetera. He is also a named inventor of a dozen US Patents owned by various companies.  

Table of Contents

  •  
    • My Motivation
    • Audience
      • Who This Book Can Help
      • Who This Book Might Not Help
    • Pre-requisites
  • Part 0 - Basic Ruby
    • The command line
    • Object Scope
    • String
    • Array
      • Special Methods
    • Hash
    • Block passing syntax
    • Reading From Files
  • Part 1 Function Overview And Simple Examples
    • Map
    • Reduce
    • Simple reduce examples
      • uniq
      • reverse
      • max
    • Select
  • Part 2 Complex Solutions
    • Debugging Blocks for Map, Reduce and Select
      • Debugging map blocks
      • Debugging reduce blocks
      • Debugging select blocks
    • Fizzbuzz
    • Sum of Odd Cubes
    • Sort a list of names by surname
    • Convert a list of names to CSV
    • Generate a random list of names
    • Clean A Data Set
    • Annotate a sequence of sales with running total
    • Pascal’s Triangle
    • Reverse Polish Notation Parser
    • Generate a list of team namebars
    • Find Intersection Points of Two Functions
    • Group by area code
    • Sliding Window Average
    • Denormalize a data set
    • Pythagorean Triplets
  • Part 3 - Reverse Engineering Complex Solutions
    • Solution For Pascal’s Triangle

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub