Having trouble reading this email? View it in your browser.
New This Week

Programming Phoenix »

Don't accept the compromise between fast and beautiful: you can have it all. At every step, you'll learn from the Phoenix creators not just what to do, but why. Packed with insider insights, this definitive guide will be your constant companion in your journey from Phoenix novice to expert, as you build the next generation of web applications.

Text Processing with Ruby »

Learn how to acquire text from any source and get it into your Ruby program. Explore techniques to process that text and then output the transformed or extracted text. Cut even the most complex text-based tasks down to size and learn how to master regular expressions, scrape information from Web pages, develop reusable utilities to process text in pipelines, and more.

Recently Released:

 

Coming Up Next:

  • iOS 9 SDK Development: Creating iPhone and iPad Apps with Swift in beta
  • Modern Perl, 4th Ed.
  • Developing for Apple Watch, Second Edition
Programming Phoenix
September 30, 2015

This is really big news. Programming Phoenix is here and ready for you. What is Phoenix, you ask?

Phoenix is the long-awaited web framework based on Elixir, the highly concurrent language that combines a beautiful syntax with rich metaprogramming. The authors, Phoenix creator Chris McCord, Elixir creator José Valim, and award-winning author Bruce Tate, walk you through building an application that's fast and incredibly reliable. They'll show you how to create code that's easier to write, test, understand, and maintain.

And oh, by the way, it runs like a speed daemon.

Don't wait, come and get started with the future today. Now available from pragprog.com/book/phoenix.

In other great news, Text Processing with Ruby: Extract Value from the Data That Surrounds You is now officially in print and shipping! Come and get your own copy from pragprog.com/book/rmtpruby.

Programming Phoenix: Productive |> Reliable |> Fast

The best way to learn Phoenix is to code, and you'll get to attack some interesting problems. Start working with controllers, views, and templates within the first few pages. Build an in-memory repository, and then back it with an Ecto database layer. Learn to use change sets and constraints that keep readers informed and your database integrity intact. Craft your own interactive application based on the channels API for the real-time, high-performance applications that this ecosystem made famous. Write your own authentication components called plugs, and even learn to use the OTP layer for monitored, reliable services. Organize your code with umbrella projects so you can keep your applications modular and easy to maintain.

This is a book by developers and for developers, and we know how to help you ramp up quickly. Any book can tell you what to do. When you've finished this one, you'll also know why to do it.

Now available from pragprog.com/book/phoenix.

Text Processing with Ruby: Extract Value from the Data That Surrounds You

Most information in the world is in text format, and programmers often find themselves needing to make sense of the data hiding within. You want to do this efficiently, avoiding labor-intensive, manual work—and Ruby is ideally suited to this task.

Text Processing with Ruby takes a practical approach to working with text:

  • First, Acquire: Explore Ruby’s core and standard library, and what’s possible with IO and its derived classes like File. Extract text into your Ruby programs from the file system and standard input. Process delimited files such as CSVs, and write utilities that interact with other programs in text-processing pipelines. Process web pages with Nokogiri to pull out information from even the messiest of HTML, and decipher character encoding mysteries.

  • Second, Transform: Use regular expressions to match, extract, and replace patterns in text. Write a parser using Ruby’s StringScanner library. Use Natural Language Processing techniques to extract keywords and implement fuzzy searching.

  • Finally, Load: Write the transformed text and data to standard output, files and other processes. Serialize text into JSON, XML, and CVS, and use ERB to create more complex formats.

You'll soon be able to tackle even the most enormous and entangled text with ease, scything through gigabytes of data and effortlessly extracting the bits that matter.

Top Five Text Processing Tips

by Rob Miller, author of Text Processing with Ruby

Clean up your data first. Data in the real world is messy. It almost always pays off to take some time to normalize different sources of data and to get them into the same format before you begin whatever actual processing you need to do. You’ll have less exceptions and special cases in your code, and it’ll be a lot more resilient.

Master regular expressions. There are definitely some text processing problems that can’t be solved with regular expressions, but not that many. While they’re not always the best or more readable option, knowing regular expressions well will get you out of many tight spots, and even more often than that will be the first step towards a more robust solution.

Break your problem into discrete steps. Almost all text processing tasks, no matter how complicated they seem on the face of it, are really a series of small transformations. Figuring out how to frame your problem in this way will make it easy to take a pipeline approach, where your text flows through a series of small, discrete steps, each of which transform the data in a particular way and then passes it on. Such programs are both easier to reason about and easier to modify and extend.

Figure out a strategy for missing data. Data in the real world, as well as being messy, also frequently has gaps. Decide early on how you’re going to cope with that — how you’ll represent the absence of particular fields or properties — and you’ll avoid messiness later on.

Make the most of existing tools. There are hundreds of command-line tools that exist solely to process textual data. Each of them is capable of performing a particular transformation, which means you don’t need to reinvent the wheel. If you use existing tools for the parts of your problem that have already been solved, all that remains is to solve the unique problem that you have.

Now available from pragprog.com/book/rmtpruby.

Upcoming Author Appearances

  • 2015-09-30 Johanna Rothman, Agile Cambridge
  • 2015-10-05 Adam Tornhill, GOTO Copenhagen, Denmark
  • 2015-10-05 Janie Clayton, 360|iDev Min; Greenville, SC
  • 2015-10-07 Adam Tornhill, GOTO Copenhagen, Denmark
  • 2015-10-09 Janie Clayton, CocoaLove 2015, Philadelphia, PN
  • 2015-10-12 Adam Tornhill, 8th Light University (London, UK)
  • 2015-10-13 Adam Tornhill, Software Architect 2015, London, UK
  • 2015-10-20 Mattias Skarin, Lean Kanban Nordic - Stop Starting 2015, Stockholm
  • 2015-10-25 Johanna Rothman, Tel Aviv, Israel
  • 2015-10-26 Adam Tornhill, Trondheim Developer Conference, Norway
  • 2015-10-26 Johanna Rothman, Tel Aviv, Israel
  • Don't Get Left Out

    Are your friends jealous that you get these spiffy email newsletters and they don't? Clue them in that all they need to do is create an account on pragprog.com (email address and password is all it takes) and select the checkbox to receive newsletters.

    Are you following us on Twitter and/or Facebook? Here's where you can find us and keep up with the latest news and commentary, and occasional discounts:

    Tell your friends! Tweet this

    Follow us on Twitter: @pragprog, @pragpub, Andy @PragmaticAndy and Dave @pragdave.

    Andy & Dave
    The Pragmatic Programmers

    Books • eBooks • PragPub Magazine • Audiobooks and Screencasts
    PragProg.com

    Manage your subscription using your account, or permanently unsubscribe here.
    Sent by the Pragmatic Programmers, LLC. • 2831 El Dorado Pkwy, #103-381 • Frisco TX 75033