January Contest: Ride4Ruby
At the DreamForce conference last month, SalesForce’s CEO, Mark Benioff, called Ruby the “Language of the Cloud.” On the show floor, I had dozens of conversations with Java developers about Ruby, and Ruby on Rails. Many of them ended up taking our Zero to Rails 3 class later that month.
In the spirit of increasing the momentum of Ruby on Rails, we have scheduled another Zero to Rails 3 class on January 24th. We are also running another contest. The prize is an Engine Yard t-shirt. For a peek at the Engine Yard crew modeling our new shirts, check out photos from Deploy Day posted to our Facebook page.
Contest Scenario
Every year, a handful of brave cyclists embark on cross-country bike rides to raise funds for various philanthropies.
Imagine you are going on an Engine Yard sponsored Ride4Ruby. The planned route hops from city to city, in search of every Ruby Street in the United States, according to Google Maps.
To win a shirt, you must do the following:
- Using Ruby, iterate over the list of states found here (cut and paste into an array)
- For each state, send a request to http://maps.google.com
- The requests should be as follows:http://maps.google.com/maps/geo?q={state}%20Ruby%20Street&output=xml&key={your google key}
- Parse your results
- Find the city, state, and zip code of the farthest eastern, and farthest western locations
- Find the distance between these cities.
- Make a request to:http://maps.google.com/maps/api/directions/xml?origin={eastern location}&destination={western location}&sensor=false@key={your google key}
- Remove your google keys from your code to protect them
- Share the code in a gist (https://gist.github.com/).
- Follow @engineyard on Twitter
- Tweet the following:
Learn #Ruby on #Rails with @engineyard http://bit.ly/02ror #Ride4Ruby [distance] [your gist]
Extra credit. Obviously, the distance your bike will be traveling is farther than the distance between the start and end points. Share Ruby code for calculating the shortest distance between all points, for an extra special prize, which will be announced next week after we look through the submissions.
Ready. Set. Go!
Note: Submissions are closed at midnight tomorrow (January 11th) PDT. Plagiarizing someone else’s code results in a flat tire. We will contact winners via Twitter the week of January 17.
Share your thoughts with @engineyard on Twitter