Ruby Metaprogramming Course – Start Thinking in Ruby

by Satish Talim on February 9, 2010

RubyLearning is honored to have Paolo Perrotta, author of the book Metaprogramming Ruby, who would be answering some of the questions in the course forum.

After the huge success of the first two “Ruby Metaprogramming” batches, RubyLearning now announces the third official batch from 6th Mar. 2010.

What’s Ruby Metaprogramming?

Paolo Perrotta has this to say:

As a Ruby programmer, you already know how much fun it is. Now see how to unleash its power, digging under the surface and exploring the language’s most advanced features: a collection of techniques and tricks known as metaprogramming. Once the domain of expert Rubyists, metaprogramming is now accessible to programmers of all levels – from beginner to expert.

Paolo goes on to say the following in a recent interview:

I realized that metaprogramming sits at the very heart of the language, and when you understand metaprogramming, that’s the moment you start “thinking in Ruby”.

Who’s It For?

Anyone who has some background in Core Ruby can make the most out of this course.

Dates

The course starts on 6th March 2010 and runs for 2 weeks. You first need to register on the site and then enroll into the course.

What Will I Learn?

The brief outline of this course is:

First Week:

  • Review the object model of Ruby itself:
    • read-only variable self
    • singleton class
    • scope of variables
  • Learn a lot of methods:
    • eval
    • instance_eval
    • class_eval (aka: module_eval)
    • class_variable_set
    • class_variable_get
    • class_variables (Try it out: instance_variables)
    • instance_variable_set (Try it out: instance_variable_get)
    • define_method
    • const_set
    • const_get (Try it out: constants)
    • Class.new (Try it out: Struct.new)
    • binding (Try it out: lambda)
    • send (Try it out: method)
    • remove_method
    • undef_method
    • method_missing
    • include
    • extend
    • included
    • extended
  • Do the following five exercises and discuss them in the forum.
    • Exercise 1: Get the values from outside the class.
    • Exercise 2: Add your code to display ‘I like metaprogramming!’
    • Exercise 3: Show lots of ways to define singleton method.
    • Exercise 4: Glance inside Ruby with binding method.
    • Exercise 5: Define a class without class and def.

Second Week:

  • Practice with assignments on how to write a tiny app with Ruby Metaprogramming techniques. The assignments are being prepared.

For Newbies

We will provide you with short study notes. You can learn the following and discuss the same in the course forum.

  • Instance variables, Methods and Classes
  • Calling a method
  • Useful methods in Ruby Metaprogramming
  • Ruby Blocks and Bindings
  • Solved Problems (two examples)

For Intermediate Participants

We willl open the discussion forum with some advanced topics like “Compare Ruby Callable Objects” (Yugui’s blog posts) etc.

Who is conducting this course?

The course is conducted by Satoshi Asakawa from Japan with 24×7 help from the mentors at RubyLearning. Satoshi is a Japanese Ruby enthusiast.

Early Bird Registration Discounts

  • For the first 20 registrations, Course Fee: US$ 5 per participant.
  • For the next 20 registrations, Course Fee US$ 7 per participant.
  • After the first 40 registrations, Course Fee US$ 9 per participant.

The course fee goes towards maintaining RubyLearning and helps provide quality content to you.

So hurry, registrations have started.

By the end of the course, and to reiterate what Paolo Perrotta said, you will understand metaprogramming and that’s the moment you will start “thinking in Ruby”.

Technorati Tags: , , , , ,

Posted by Satish Talim

{ 7 comments }

Follow me on Twitter to communicate and stay connected

Indian Ruby on Rails Portfolio

by Satish Talim on February 8, 2010

Indian Ruby on Rails Portfolio

I am compiling a list (in alphabetical order) showcasing Indian websites made with Ruby on Rails. Hat Tip: Fabio Akita

Adomado

Adomado

Adomado is India’s first Internet rewards program. They are an advertising and product offer supported model and help you to earn exciting rewards for performing a range of online activities. They also help their users to support their favorite charity without paying any money. Users can checkout their exciting offers at http://adomado.com/inside/my_offers which they keep on updating from time to time.

The site was created in 2009 and is hosted by Amazon EC2. The contact person is Mayank Jain.

Ads4Good

Ads4Good

Ads4Good is a social venture startup which provides users with ad-widgets (adjets) that can be easily placed on websites, blogs and other web pages and the funds generated from ads on the widget gets donated to support causes of users’ interest. This makes it an easy, ongoing and sustainable way of contributing back to society. They also ensure a win-win situation for everyone involved – users get to donate with no out-of-pocket spend and get visibility of the impact; organizations get actionable funds; advertising networks get increased reach.

The site was created in 2009 and is hosted at Linode, Amazon S3/Cloudfront. The contact person is Akshay Surve.

BubbleIdeas

BubbleIdeas

BubbleIdeas is a Gov 2.0 solution, Organized Crowdsourcing, Customer engagement, Ideas etc. The offering is SAAS and much more simpler and leaner than most solutions available on the web.

The site was created in 2010 and is hosted by Slicehost. The contact person is Arvind Nigam.

BumsOnTheSaddle

BumsOnTheSaddle

At BumsOnTheSaddle, they love cycling and are trying to make a difference in the way cycling is experienced in India. It is a mass of Rails sites:

  • Mephisto blog
  • Signal Wiki
  • and a couple of more features, that are in the pipeline and yet to be released. The main site is also going to be refreshed with community features using Tog engine.

The site was created in 2006 and is hosted by Hosting Rails. The contact person is Rohan Kini.

Fedena

Fedena

Fedena is an open source school/campus management system developed using Ruby on Rails. With Fedena, they hope to be able to provide an easy solution to schools and colleges to manage their activities online. Fedena has many different fetures such as student database management, timetable, attendance and examination results management, and also human resources and finance management.

The site was created in 2009 and is hosted by hosted by Hosting Rails. The contact person is Arvind GS.

HirePlug

HirePlug

HirePlug is a Social Hiring portal. Their goal is to make hiring fast, effective and fun. Job Boards seriously lack top talent. The same talent is available on the Social Networks and is untapped. The idea revolves around providing a unified platform for Talent Management, Job Board and leveraging social networks for hiring the top talent by means of referral hiring.

The site was created in 2009 and is hosted by ServerLoft. The contact person is Rajan Chandi.

Josh Software Pvt. Ltd.

Josh Software Pvt. Ltd., Pune

Josh Software Pvt. Ltd., Pune company’s website was developed using eJOSH, an open source custom ROR CMS. A great way of showing that Josh Software is a true Ruby on Rails development company. Some of the many ROR based sites developed by JoshSoftware are: Paisa Matters and BrandPotion.

The JoshSoftware site was created in 2009 and is hosted on linode VPS server. The contact person is Gautam Rege.

MangoSpring Engage

MangoSpring Engage

MangoSpring Engage is a smart set of employee communication and social collaboration tools to boost daily productivity while creating a smart company for this decade. By smart, they mean Engage infuses intelligence in communication systems and day to day processes; creating a vibrant, open company. More than a tool, Engage is a way of working, a way of collaborating and a way of creating an informed, productive workforce.

The site was created in 2010 and is hosted at Adhost. The contact person is Vishwa Malhotra.

PurpleTrail

PurpleTrail

PurpleTrail is the only online service that gives you, stylish, ad-free invitations and eCards for FREE! It now also offers creating and sending personalized printed invitations and cards in minutes. You can order professionally printed cards or print them at home. It truly is as easy as 1-2-3!

The site was created in 2007 and is hosted at Adhost. The contact person is Vishwa Malhotra.

ShipX

ShipX

ShipX is India’s first web-based freight shopping and booking platform. Their goal is to revolutionize the way shippers search, book, and ship their freight. Their easy-to-use portal helps shippers to instantly get competitive quotes from top-quality service providers, compare them side-by-side, make a choice, and book their shipment.

They are working on their beta release, it will be launched in about a month’s time. Alpha version (to understand the market and customer needs) was launched in later half of 2008 and was well received.

The site is hosted by Slicehost. The contact person is Abhinav Saxena.

UnitedProsperity

UnitedProsperity

UnitedProsperity is a non-profit organization that helps you combat extreme global poverty powerfully by multiplying the impact of your money through loan guarantees. It is the world’s first social guaranteeing website.

The site was created in 2009 and is hosted by A2Hosting. The contact person is Bhalchander Vishwanath.

WebROaR

WebROaR

WebROaR is an application server that makes deployments of Ruby web applications extremely simple. It provides an integrated solution to view the run time performance numbers and email notifications in case any exceptions occur in any of the deployed applications. The server’s extremely user friendly admin panel itself is a Ruby on Rails application.

The server is 5 to 55% faster than all other comparable deployment stacks for Ruby on Rails applications. It is freely available under GPLv3.

The site was created in 2009 and is hosted by Slicehost. The contact person is Aditya Babbar.

Whol.ly

Whol.ly

Whol.ly brings the power of local currencies and the best of social networking to your neighborhood. Their purpose is to dramatically improve communication across neighborhoods while stimulating solidarity and creative activity among neighbors.

The site was created in 2009 and is hosted by Amazon EC2. The contact person is Abhishek Parolkar.

YouSuggest

YouSuggest

YouSuggest is a SaaS product which allows companies to build crowdsourced communities around customer feedback, ideas and suggestions. It was launched almost at the same time with the competitor UserVoice and has seen good traction among Indian enterprises. It powers many high-profile public communities like TalkToHT as well as private installations for customers worldwide.

The site was created in 2008 and is hosted by Slicehost. The contact person is Arvind Nigam.

Update

I’ll be updating this page from time to time. If you are the owner / developer of such a website(s), then I would appreciate if you would send me by email, as much information about the same. Namely:

  1. 150×91 thumbnail and the URL to the website.
  2. 4-5 line details about this website(s) that includes what the site is about, when (year) it was created, the contact person’s name and email id, the name and URL of the hosting company where the site is hosted.

If you are aware of any such Indian website(s) made with Ruby on Rails, please send me the following -

  1. the URL of the website(s).
  2. the contact person’s email id, if known.

Thank you for your time and help.

Technorati Tags: , , ,

Posted by Satish Talim

{ 41 comments }

Follow me on Twitter to communicate and stay connected

RPCFN: Fair Distribution (#6)

by Satish Talim on January 26, 2010

Ruby Programming Challenge For Newbies

RPCFN: Fair Distribution (#6)

By John Trupiano

About John Trupiano

John TrupianoJohn Trupiano (twitter) is the co-founder of SmartLogic, the premiere Ruby development team in Baltimore, Maryland. He is an active member in the technology and business communities in the mid-Atlantic region. He is highly involved with the local Ruby user group (Bmore on Rails) and recently organized the first ever Maryland TechCrawl, a show and tell event showcasing the exciting and innovative technologies being developed in the region. He is also very active in the open source community having authored timecop and Rack::Rewrite and contributing to a slew of projects including rails, capistrano, shoulda, factory_girl, gemcutter and multitest.

John has this to say about the challenge:

I think the Ruby challenge is great because it instills from the very start the idea that you need to practice to become a great programmer. Even as a problem setter, I have found the exercise of defining a problem and iterating through various solutions to be extremely educational and beneficial. Satish has cultivated a fantastic program here that provides access for beginners to seasoned Ruby programmers. Furthermore, the Ruby challenge serves as a notice to the Ruby community that it is important for us to provide a welcoming and nurturing environment for newcomers.

Our Awesome Sponsors

This monthly programming challenge is co-sponsored by Backup My App and Caliper.

Backup My App

Backup My App is an automatic backup service for Ruby on Rails applications. You simply install the plugin to your Rails application and they handle the rest of the process. They store backup history for several weeks and you can restore any of them automatically. Try out their 1 GB plan for free. Backup My App has co-sponsored this challenge and is proud to make this contribution to the Ruby community.

Caliper

Caliper provides free, hosted metrics for Ruby programmers. Find duplication, code smells, complex code and more! Get set up with just one click!

Prizes

  • The participant with the best Ruby solution (if there is a tie between answers, then the one who posted first will be the winner) will be awarded any one of PeepCode’s Ruby on Rails screencasts and a free 10 GB account for a year from Backup My App.
  • From the remaining working Ruby solutions, three participants would be selected randomly and each one would be awarded any one of Pragmatic’s The Ruby Object Model and Metaprogramming screencasts.
  • All the participants in this challenge (except the participant with the best Ruby solution) will get a free 5 GB account for 6 months from Backup My App.

The four persons who win, can’t win again in the next immediate challenge but can still participate.

The Ruby Challenge

RPCFN

The Challenge

Imagine that you manage a t-shirt printing company. Each morning you review all orders placed the prior day and determine how long each order will take to fulfill. On any given day, only a certain number of your printing machines are operational. Your job is to schedule each printing job with one of the operational printing machines in such a manner that (a) all t-shirts are printed in the least amount of time, and (b) the distribution of work across machines is as fair as possible (i.e. the standard deviation of the time each machine spends working is minimized).

Your objective is to write a FairDistribution class that satisfies the following test cases. The code in the test cases is sufficient to define the methods you must implement.

This is an NP complete problem, and as such I have only provided very small datasets in the test cases. Test case #3 takes the longest to solve (See **Notes below about how to run the Test Case #3) and you may find it easier to comment it out early in your development phase. On a MBP Pro with a 2.4 GHz dual core processor and 4GB RAM, it took just over 3 minutes to solve. The other three test cases took only a couple of seconds.

Note that test cases 2 and 4 define specific distributions against which you can verify. Test cases 1 and 3 have more than one acceptable distribution and as such I have not provided a specific distribution to test against.

Note also that there is a well known algorithm that provides a much faster though not optimal solution. It will pass all tests except for test case #3. If you are only able to determine this particular solution, please still consider submitting your solution for consideration.

** Notes: To accommodate the fact that Test Case #3 takes a long time to run, you can run the test normally, and TC#3 will not run. When you want the TC#3 to run, then you can run the following:

ruby test_solution_acceptance.rb full

The word “full” will signal it to run all the test cases.

The Test Suite

test_solution_acceptance.rb

Requirements

The solution to the challenge has to be a pure Ruby script, using only the Ruby Standard Libraries (meaning, no external Gems). You do not need to build a gem for this. Pure Ruby code is all that is needed.

How to Enter the Challenge

Read the Challenge Rules. By participating in this challenge, you agree to be bound by these Challenge Rules. It’s free and registration is optional. You can enter the challenge just by posting the following as a comment to this blog post:

  1. Your name:
  2. Country of Residence:
  3. GIST URL of your Solution (i.e. Ruby code) with explanation and / or test cases:
  4. Code works with Ruby 1.8 / 1.9 / Both:
  5. Email address (will not be published):
  6. Brief description of what you do (will not be published):

Note:

  • As soon as we receive your GIST URL, we will fork your submission. This means that your solution is frozen and accepted. Please be sure that is the solution you want, as it is now recorded in time and is the version that will be evaluated.
  • All solutions posted would be hidden to allow participants to come up with their own solutions.
  • You should post your entries before midnight of 20th Feb. 2010 (Indian Standard Time). No new solutions will be accepted from 21st Feb. onwards.
  • On 21st Feb. 2010 all the solutions will be thrown open for everyone to see and comment upon.
  • The winning entries will be announced on this blog before end of Feb. 2010. The winners will be sent their prizes by email.

More details on the RPCFN?

Please refer to the RPCFN FAQ for answers to the following questions:

Donations

RPCFN is entirely financed by RubyLearning and sometimes sponsors, so if you enjoy solving Ruby problems and would like to give something back by helping with the running costs then any donations are gratefully received.

Click here to lend your support to: Support RubyLearning With Some Love and make a donation at www.pledgie.com !

Acknowledgements

Special thanks to:

  • John Trupiano.
  • Sponsors Caliper and Backup My App.
  • GitHub, for giving us access to a private repository on GitHub to store all the submitted solutions.
  • The RubyLearning team, namely Jeff Savin (Canada), Mareike Hybsier (Germany), Peter Crawford (Italy) and Satoshi Asakawa (Japan).

Questions?

Contact Satish Talim at satish [dot] talim [at] gmail.com OR if you have any doubts / questions about the challenge (the current problem statement), please post them as comments to this post and the author will reply asap.

The Participants

There are two categories of participants. Some are vying for the prizes and some are participating for the fun of it.

In the competition

  1. Rajesh Tripathi, USA
  2. Aleksey Gureiev, Australia
  3. Aldric Giacomoni, USA
  4. Adam Lum, USA
  5. Brad O’Connor, Australia
  6. Martin Linkhorst, Germany
  7. Elijah Miller, USA

Just for Fun

  1. Dominik Masur, Germany

Previous Challenge

RPCFN: Mazes (#5) by Peter Cooper.

Note: All the previous challenges, sponsors and winners can be seen on the Ruby Programming Challenge for Newbies page.

Update

  • The (#7) challenge by James Edward Gray II, USA is scheduled for 1st Mar. 2010.

Technorati Tags: , , , , ,

Posted by Satish Talim

{ 28 comments }

Follow me on Twitter to communicate and stay connected