Tuesday, April 7, 2009

Week 2: Rails Passion Course

  1. Week 2's Theme is Ruby Blocks and Closures (Topics covered: What is block?, How to create a block?, How does a block get passed and executed?, Proc object, & operator, lambda, Where do blocks get used?, What is a closure.) and here are the references from the web site:
  2. Here is the PDF file: Presentation (4/7/2009: Read/Printed out ~half pages)
    1. PDF: 1 slide per page (33 pages)
    2. OpenOffice file
  3. Exercise #1: Ruby Blocks (p.1-9)
  4. (1.1) RubyBlock_TwoFormats (p.2-4)
  5. (1.2) RubyBlock_yieldExecuteSuppliedBlock (p.4-7)
  6. (1.3) RubyBlock_yieldWithParameters (p.7-8)
  7. (1.4) RubyBlock_yieldWithParameters2 (p.8-9)
  8. Exercise #2: Proc object and lambda (p.9-15)
  9. (2.1) RubyBlock_Proc_CreateAndCall (p.9-10)
  10. (2.2) RubyBlock_Proc_CreateAndCall2 (p.10-11) - Had to type it in, but easy.
  11. (2.3) RubyBlock_Proc_AsReturnValue (p.11)
  12. (2.4) RubyBlock_Proc_AsArgument (p.11-12)
  13. (2.5) RubyBlock_lambda (p.12)
  14. (2.6) RubyBlock_lambda_diffFromProcNew1 (p.13-14) - Got Different Output (think ok).
  15. (2.7) RubyBlock_lambda_diffFromProcNew2 (p.15)
  16. Exercise 3: Ruby & (Ampersand) Operator (p.15-17)
  17. (3.1) RubyBlock_Ampersand_blockToProc (p.16)
  18. (3.2) RubyBlock_Ampersand_ProcToBlock (p.17)
  19. Exercise #4: Blocks and Iterators (p.17-19)
  20. (4.1) RubyBlock_Iterator (p.18)
  21. (4.2) RubyBlock_Iterator2 (p.18-19)
  22. Exercise #5: Closure Basics (p.19-
  23. (5.0) RubyClosure_example0 (p.20-21)
  24. (5.1) RubyClosure_example1 (p.21)
  25. (5.2) RubyClosure_example2 (p.21-22) -- Tricky ;>)
  26. (5.3) RubyClosure_example3 (p.22-23)
  27. (5.4) RubyClosure_example4 (p.23-24) -- Finished at 4:30pm.
  28. Lab and homework
    1. 5512_ruby_blocks.zip (Unzip it in a directory of your choice and read lab document from /ruby_blocks/index.html to proceed)
    2. Online lab document (This is the same document you will find in the hands-on lab zip file)
    3. Homework
    4. Change Log

No comments:

Post a Comment