Start learning with our library of video tutorials taught by experts. Get started

Code Clinic: Ruby
Illustration by Don Barnett

Code Clinic: Ruby

with Kevin Skoglund

Video: A templating problem

- Hello, and welcome to Code Clinic. My name is Kevin Skoglund. Code clinic is a monthly course where a unique problem is introduced to a collection of Lynda.com authors. In response, each author will create a solution using their programming language of choice. You can learn several things from Code Clinic. Different approaches to solving a problem, the pros and cons of different languages, and some tips and tricks to incorporate into your own coding practices. This month, we're working on a problem common to anyone building a website or a port, specifically merging live data with static templates.
Expand all | Collapse all
  1. 3m 48s
    1. Welcome
      1m 7s
    2. What you should know before starting this course
      1m 17s
    3. Using the exercise files
      37s
    4. Getting the most from Code Clinic
      47s
  2. 52m 41s
    1. Introducing Lake Pend Oreille
      4m 32s
    2. Overview of my solution
      2m 29s
    3. Accepting user input
      7m 59s
    4. Validating user input
      6m 59s
    5. Retrieving remote data
      8m 29s
    6. Data calculations
      6m 30s
    7. Output results
      3m 57s
    8. API
      11m 46s
  3. 1h 2m
    1. Introducing image analysis
      3m 1s
    2. Hints, tips, and tricks
      2m 53s
    3. Overview of my solution
      3m 51s
    4. ImageMatcher
      12m 19s
    5. Matching exact pixels
      13m 11s
    6. Matching similar pixels
      6m 18s
    7. Determining the best match
      5m 30s
    8. Optimizations
      6m 53s
    9. Matching with OpenCV
      8m 21s
  4. 1h 10m
    1. Eight Queens problem
      1m 46s
    2. Hints, tips, and tricks
      3m 54s
    3. Overview of my solution
      5m 55s
    4. Queen and board classes
      6m 10s
    5. Displaying the board
      7m 1s
    6. Determining safe positions
      6m 48s
    7. Using loops
      7m 8s
    8. Loops with backtracking
      5m 12s
    9. Loops with smarter backtracking
      6m 2s
    10. Recursion primer
      3m 45s
    11. Using recursion
      6m 52s
    12. Finding all possible solutions
      5m 46s
    13. Further exercises
      3m 56s
  5. 56m 39s
    1. Accessing peripherals problem
      1m 22s
    2. Hints, tips, and tricks
      3m 20s
    3. Overview of my solution
      5m 43s
    4. Installing Gosu
      4m 31s
    5. Creating PitchMaker
      9m 7s
    6. Adding an indicator
      9m 12s
    7. Starting and stopping the tone
      5m 5s
    8. Changing volume
      4m 36s
    9. Changing pitch
      4m 54s
    10. Piano: Using semitone pitches
      8m 49s
  6. 45m 51s
    1. Introduction
      2m 6s
    2. Hints, tips, and tricks
      3m 15s
    3. Overview of my solution
      2m 54s
    4. Making a plan
      5m 18s
    5. Finding images with recursion
      10m 37s
    6. Finding images a simpler way
      3m 21s
    7. Install exiftools
      2m 21s
    8. Inspect images for metadata
      7m 33s
    9. Organize images by caption
      8m 26s
  7. 50m 42s
    1. A templating problem NEW
      1m 31s
    2. Hints, tips, and tricks NEW
      1m 35s
    3. Overview of my solution NEW
      3m 12s
    4. Parsing CSV files NEW
      6m 9s
    5. ERB templating NEW
      9m 2s
    6. CurriculumMaker NEW
      5m 56s
    7. Parsing course data NEW
      3m 42s
    8. Creating an ERB template NEW
      10m 15s
    9. Using the ERB template NEW
      4m 15s
    10. Savings results to a new file NEW
      5m 5s

Watch this entire course now —plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Watch the Online Video Course Code Clinic: Ruby
5h 42m Intermediate Jul 15, 2014 Updated Dec 16, 2014

Viewers: in countries Watching now:

Many successful programmers know more than just a computer language. They also know how to think about solving problems. They use "computational thinking": breaking a problem down into segments that lend themselves to technical solutions. Code Clinic is a series of six courses where lynda.com authors solve the same problems using different programming languages. Here, Kevin Skoglund works with Ruby.

Each month, Kevin will introduce a new challenge and provide an overview of his solution in Ruby, explaining how he broke the problem up into logical components, and revealing the difficulties he encountered. Challenges will include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.

Visit other courses in the series to see how to solve the exact same challenge in languages like C#, C++, Java, PHP, and Python. And check back every month for new challenges.

Subjects:
Developer Programming Languages
Software:
Ruby Ruby on Rails
Author:
Kevin Skoglund

A templating problem

- Hello, and welcome to Code Clinic. My name is Kevin Skoglund. Code clinic is a monthly course where a unique problem is introduced to a collection of Lynda.com authors. In response, each author will create a solution using their programming language of choice. You can learn several things from Code Clinic. Different approaches to solving a problem, the pros and cons of different languages, and some tips and tricks to incorporate into your own coding practices. This month, we're working on a problem common to anyone building a website or a port, specifically merging live data with static templates.

Data's only useful when we can effectively communicate it to someone else. And to do that, we need to format it into some sort of meaningful visual representation. Sometimes this takes the form of a printed report, most likely, it means publishing data to a webpage. In this problem, we have the pre-formatted HTML webpage and we have two data files in CSV format. Our job is to write code that will insert the data files into the webpage to apply the proper formatting. We're going to use the files created by James Williamson in Chapter 9 of his course titled, Dreamweaver CC Essential Training.

James provides all the material we need for this challenge. If you'd like to attempt your own solution, you can download the exercise files for that course, or you can find the same content included in the exercise files for this course. In the next videos, I'll show you how I solved this challenge.

Find answers to the most frequently asked questions about Code Clinic: Ruby .


Expand all | Collapse all
please wait ...
Q: I'm running Windows and can't get some of the code shown in the videos to install. Is there something else I need to do?
A: For exercises that compile third-party code, Windows users may need to install the RubyInstaller Development Kit (DevKit).  DevKit is a MSYS/MinGW-based toolkit than enables you to build many of the native C/C++ extensions available for Ruby. DevKit was previously included in the Windows installer, but now requires a separate download and installation. The installation instructions are available at https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Code Clinic: Ruby.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.